=> Appending nvm source string to /root/.bashrc => Appending bash_completion source string to /root/.bashrc => Close and reopen your terminal to start using nvm or run the following to use it now:
# 启动MySQL systemctl start mysqld # 查看MySQL运行状态 systemctl status mysqld # 进入MySQL还得先找出此时root用户的密码,通过如下命令可以在日志文件中找出密码 grep "password" /var/log/mysqld.log # 进入数据库 mysql -u root -p # 修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
# 注意:重点啊,如果你没有设置认证方式,默认的密码加密方式是:caching_sha2_password,而现在很多客户端工具还不支持这种加密认证方式,连接测试的时候就会报错:client does not support authentication protocol requested by server; consider upgrading MySQL client,这里的错误信息就是不支持身份认证方式,没关系,去/etc/my.cnf里面在[mysqld]下面加上这句话即可: default_authentication_plugin=mysql_native_password
# 开启mysql的远程访问(如要开启所有的,用%代替IP) grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option; flush privileges; # 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 'Chjiyun123456' WITH GRANT OPTION' at line 1
非root用户,这里就要先去创建一个用户
1 2 3 4 5 6 7 8 9 10 11 12
use mysql; CREATE USER 'user1'@'%' IDENTIFIED BY '123456'; grant all on *.* to 'user1'@'%'; # 注意:用以上命令授权的用户不能给其它用户授权,如果想让该用户可以授权,用以下命令: # GRANT all ON databasename.tablename TO 'username'@'host' WITH GRANT OPTION; \q # 退出 mysql