Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure mariadb remote access to solve the problem of database garbled

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to configure mariadb remote access rights to solve the database garbled problem, the article is very detailed, has a certain reference value, interested friends must read it!

Configure mariadb remote access:

1) log in to the database:

# mysql-uroot-p

2) configure remote access permissions for authorized database users,% represents all remote IP, or you can specify IP. WITH GRANT OPTION represents the reload of permission data in the grant table of the mysql database:

GRANT ALL PRIVILEGES ON *. * TO 'username' @'% 'IDENTIFIED BY' user password 'WITH GRANT OPTION

Once configured, perform a refresh to make it effective:

Flush privileges

Solve the problem of Chinese garbled display in mariadb:

Mariadb main configuration file (yum installation directory: / etc/my.cnf):

You can see that the configuration is very simple, and the configuration files in the my.cnf.d directory are also introduced.

Edit the client.cnf file in the my.conf.d directory and add under [client]:

Default-character-set=utf8

Edit the mysql-clients.cnf in the my.conf.d directory and add under [mysql]:

Default-character-set=utf8

Edit the server.cnf in the my.conf.d directory and add under [mysqld]:

Init_connect='SET collation_connection = utf8_general_ci'init_connect='SET NAMES utf8'character-set-server=utf8collation-server=utf8_general_ciskip-character-set-client-handshake

Restart the mariadb service to solve the Chinese garbled problem:

# systemctl restart mariadb.service above is all the contents of the article "how to configure mariadb remote access to solve database garbled". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report