MySql历史版本下载地址
启动服务
[root@seiang software]# systemctl start mysqld.service
查看服务状态
[root@seiang software]# systemctl status mysqld.service
mysqld --user=mysql --basedir=/home/mysql/mysql8 --datadir=/home/mysql/mysql8/data --initialize
MySQL8创建用户与授权时分开的,如果使用MySQL5的授权方式会出现以下错误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'zhaoty' WITH GRANT OPTION' at line 1
#创建账户(% 代表所有IP) create user 'root'@'%' identified by 'password' #赋予权限,with grant option这个选项表示该用户可以将自己拥有的权限授权给别人 grant all privileges on *.* to 'root'@'%' with grant option
#修改用户密码 alter user 'root'@'localhost' identified with mysql_native_password by 'zhaoty'; #刷新权限 flush privileges;