mysql5.7.10的版本不同操作

mysql5.7.10的版本不同操作

1. 数据库初始化:

old : /usr/local/mysql/scripts/mysql_install_db --datadir=/usr/local/mysql/data/ --basedir=/usr/local/mysql --user=mysql

new : /usr/local/mysql/bin/mysqld --initialize --datadir=/usr/local/mysql/data/ --basedir=/usr/local/mysql --user=mysql

 

2. 修改或设置用户密码:

old : UPDATE user SET password=PASSWORD('123456') WHERE user='root';

new : UPDATE user SET authentication_string=PASSWORD('123456') WHERE user='root';

 

3. 第一次修改密码:

SET PASSWORD = PASSWORD('123456');

 

4. 外网访问:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

 

 

flush privileges

posted @ 2024-07-16 08:40  昵称昵称昵称  阅读(4)  评论(0编辑  收藏  举报