centos7 install mysql Precautions

yum安装
yum -y install mariadb-server

Start Service
systemctl start mariadb.service

At startup
systemctl enable mariadb.service

Change password
/ usr / bin / mysqladmin -u root password '123456'
or: mysqladmin -u root password '123456'

Landing
mysql -uroot -p123456

Reference: https: //www.cnblogs.com/uncleyong/p/10739530.html

Connection problems occur when Navicat:

1,10060 question:

We can view the running status of the firewall centos7

Check the status of centos7 firewalld of systemctl status firewalld:

View firewall port to be accessed hosts run: firewall-cmd --zone = public --list-ports

If the firewall is not open port 3806 (MySQL port), then you need to add port 3806 is allowed to be accessed externally

firewall-cmd --zone=public --add-port=3806/tcp --permanent

Reload firewalld firewall configuration to take effect: firewall-cmd --reload

Finally, look at the port: firewall-cmd --zone = public --list-ports

 

 

2,1045 question:

mysql -u root mysql 

Then set a new password to the root user:

  1. mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';  
  2. mysql> FLUSH PRIVILEGES;  
  3. mysql> quit

 

Guess you like

Origin www.cnblogs.com/aiyumo/p/12063554.html