wget https://dev.mysql.com/get/mysql80-community-release-el8-4.noarch.rpm; rpm -ivh mysql80-community-release-el8-4.noarch.rpm; yum install mysql-server; chown -R mysql:mysql /data/mysql systemctl enable mysqld; systemctl start mysqld;
查看初始密码:
grep "password" /var/log/mysql/mysqld.log
设置:
port=13307 max_connections=1024 lower_case_table_names=1 default-time_zone = '+8:00'
以指定设置创建数据库:
mysqld --defaults-file=my.ini --initialize –console
创建root@%用户:
alter user 'root'@localhost' identified by 'JoyCode@2022'; create user 'root'@'%' identified by 'JoyCode@2022'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;#8以后 flush privileges;
若密码过于简单,可关闭密码验证:
set global validate_password_policy=0; set global validate_password_length=1;
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END