Install Mysql in the Liunx environment and mysql in the liunx Environment
1.1View the installation path of mysql:
[Root @ bogon ~] # Whereis mysql
Mysql:/usr/bin/mysql/usr/lib/mysql/usr/share/man/man1/mysql.1.gz
1.2
View the mysql installation package:
[Root @ bogon ~] # Rpm-qa | grep mysql
Mysql-community-client-5.6.26-2.el6.i686
Mysql-community-release-el6-5.noarch
Mysql-community-common-5.6.26-2.el6.i686
Mysql-community-libs-5.6.26-2.el6.i686
Mysql-community-server-5.6.26-2.el6.i686
1.3
Uninstall mysql
[Root @ bogon ~] # Yum remove mysql
Delete mysql database files:
Delete the/var/llib/mysql directory
1.4
Install mysql
Step 1: Download the mysql yum source package for linux from the official oracle website.
Step 2: Upload the yum source package to linux for installation.
[Root @ bogon ~] # Yum localinstall mysql-community-release-el6-5.noarch.rpm
[Root @ bogon ~] # Yum install mysql-server
Step 3: Start mysql
[Root @ bogon ~] # Service mysqld start
Step 4: Set the password for the root user
[Root @ bogon ~] #/Usr/bin/mysqladmin-u root password 'root'
Step 5: remote connection authorization
Grant all privileges on *. * TO 'myuser' @ '%' identified by 'mypassword' with grant option;
Note: replace 'myuser' and 'mypassword' with the actual user name and password.
Mysql> grant all privileges on *. * TO 'root' @ '%' identified by 'root' with grant option;