# 进入数据库 [root@localhost ~]# mysql -uroot -p # 修改数据库密码 mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password'; # 这里注意一下,如果密码设置过于简单会报错 # 如果想设置简单密码,我们可以设置下密码策略 #查看密码策略 show variables like '%validate_password_policy%'; show variables like '%validate_password_length%'; #修改密码策略 # 0(Low)只校验长度 # 1(Medium)校验长度、大小写和特殊字符 # 2(Strong)校验长度、大小写、特殊字符和dictionary_file set global validate_password_policy=0; set global validate_password_length=1;
3、开启mysql的远程访问
1 2 3 4
mysql> grant all privileges on *.* to 'root'@'%' identified by '你的密码' with grant option;
# 刷新 mysql> flush privileges;
4、更改mysql语言
1 2 3 4 5 6 7 8 9 10
# 进入配置文件 vi /etc/my.cnf # 新增几行代码 [client] default-character-set=utf8