自学内容网 自学内容网

yum 安装mysql8.0 配置数据库,导入数据库

sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
sudo rpm -ivh mysql80-community-release-el7-3.noarch.rpm


sudo yum install --nogpgcheck mysql-community-server

sudo systemctl start mysqld
sudo grep 'temporary password' /var/log/mysqld.log

sudo mysql_secure_installation


 

mysql -uroot -p
use mysql;

#配置远程登录
CREATE USER 'root'@'%' IDENTIFIED BY '123456'; 
GRANT ALL ON *.* TO 'root'@'%'; 
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';

FLUSH PRIVILEGES;

 
scp db.tar.gz root@192.168.1.2:/home
tar -xzvf db.tar.gz
mysql -u root -p online-multi < db.sql


 


原文地址:https://blog.csdn.net/zwhfyy/article/details/143560088

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!