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

Mysql Learning Notes (2-initialization)

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

Share

Shulou(Shulou.com)06/01 Report--

Initialize:

(1) set password for root users (in three ways):

SET PASSWORD FOR 'username'@'host' = PASSWORD (' your_password')

Update mysql.user set password=PASSWORD ('your_password') where user='username' and host='hostname or ip'

Mysqladmin-uUSERNMAE-hHOSTNAME_OR_IP-p password' new_password'

(2) Delete anonymous users:

DROP USER'@ 'HOSTNAME'

The above steps can run the command; mysql_secure_installation

(3) it is recommended to turn off the function of anti-resolution of host name.

Vim / etc/my.cnf

Skip-name-resolve

Find the path:

/ etc/my.cnf-- > / etc/mysql/my.cnf-- > $MYSQL_HOME/my.cnf->-- default-extra-file=/path/to/somedir/my.cnf-- > ~ / .my.cnf

The farther back, the last effective

-- configuration files read extra by defaults-extra-file=#:

-- defaults-file=#: reads only the configuration files specified here

Common options for mysql client programs:

-ummai limel, limey, and limeport

Import bulk scripts: log in to source / path/script.sql or mysql < / path/script.sql at mysql

Mysql single statement insert: mysql-e 'sql statement'

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