1、删除空用户,空密码,并创建用户名密码
delete from mysql.user where user=
‘‘
;
update mysql.user
set
password=password(
‘123‘
) where user=
‘root‘
;
delete from mysql.db where user=
‘‘
;
flush privileges;
2、创建数据库并授权给用户
create database mysqldb default charset utf8;
grant all on mysqldb.* to [email protected] identified by
‘123‘
;
3、对于并发数高时需要修改mysql的最大连接数,否则会报错,
最大值16384
查看最大连接数
show variables like ‘%max_connections%‘;
修改最大连接数
set GLOBAL max_connections = 1000;
时间: 2024-12-25 17:56:58