Install MySQL and CentOS-linuxmysql in centos-Linux
1. Install mysql
Yum (all called Yellow dog Updater, Modified) is a Shell front-end Package Manager in Fedora, RedHat, and CentOS. Based on RPM package management, You can automatically download and install the RPM package from the specified server, and automatically handle dependencies. you can install all dependent software packages at a time without the need for tedious download and installation.
Step 1: Install yum
yum install perl
Step 2: view previous versions
Step 3: Use yum to uninstall a previous version
Step 4: Use yum to install the server and client
Step 4-1: Create a folder mysql5.5 in/usr/local/src/java
mkdir /usr/local/src/java/mysql5.5
Step 4-2: Move the mysql package to/usr/local/src/java/mysql5.5
mv MySQL-5.5.49-1.linux2.6.i386.rpm-bundle.tar /usr/local/src/java/mysql5.5/
Step 4-3: Decompress the mysql package
tar -xvf MySQL-5.5.49-1.linux2.6.i386.rpm-bundle.tar
Step 4-4: Install the server
rpm -ivh MySQL-server-5.5.49-1.linux2.6.i386.rpm
Step 4-5: Install the client
rpm -ivh MySQL-client-5.5.49-1.linux2.6.i386.rpm
Step 5: Start the server
service mysql start
Step 6: change the password
/usr/bin/mysqladmin -u root password '123456'
Step 7: log on to mysql
mysql -uroot -p123456
Step 8: Create a remote Logon account
Create remote user and password
create user 'telnet'@'%' identified by '123456';
Grant this user permission
grant all on *.* to 'root'@'%' with grant option;
Refresh permission
flush privileges;
Step 8: Modify the firewall configuration file and allow port 3306
8-1: edit the firewall configuration file
vim /etc/sysconfig/iptables
8-2: Add configuration content
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
8-3: restart the Firewall
service iptables reload
Step 9: restart the mysql server
Disable the server:
service mysql stop
Start the server
service mysql start
Step 10: test the remote connection data
Use other computers to remotely log on to the database. Take Navicat Premium as an example. For example, enter the relevant information and click test connection. If the connection is successful, the entire installation process is completed.