添加新用户 允许本地 IP 访问 localhost, 127.0.0.1 create user 'test'@'localhost' identified by '123456'; 允许外网 IP 访问 create user 'test'@'%' identified by '123456'; 刷新授权 flush privileges; 为用户创建数据库 create database test DEFAULT CHARSET utf8 COLLATE utf8_general_ci;…
mysql在最新的版本中会生成随机密码,存储在/etc/my.conf的文件中,但是大多数使用者不会在意这个,因为随机的密码识别性太差,所以我们可以自己配置数据库用户以及设置密码. 设置跳过密码登陆root用户 skip.grant.table 登陆 mysql -u root -p 修改用户密码 update user set password=password("1q2w3e4r") where user="root"; flush privileges; 创建…