Linux system installed Mysql database

1. First official website address to download two packages. Download: http://dev.mysql.com/downloads/mysql/5.6.html#downloads the download page there, select the following:

Here Insert Picture Description

Note that download a client, a server, two procedures (if slower access, direct attachment with the end of the text) need
2, check whether the system is already installed mysql mariadb

-qa RPM | grep -i mysql
RPM -qa | grep -i MariaDB
Because CentOS default database is mariadb, this will conflict and mysql, it will first try to uninstall what
rpm -e mariadb-libs-1: 5.5.44-2 .el7.centos.x86_64 --nodeps
Also, if mysql installation is displayed, use the following command to uninstall,
RPM -e mysql-libs use this command to delete, if prompted other files have dependencies can not be deleted.
rpm -e --nodeps mysql-libs use the delete command, whether or not there are dependent files, can be a powerful deleted.

3, if during the installation process prompted to find or net-tools such as Perl, follow the prompts to install yum

yum install Perl
yum install net-tools
yum install -y perl-Module-Install.noarch

4, enter the file download directory to install it

rpm -ivh MySQL-client-5.6.32-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-server-5.6.32-1.linux_glibc2.5.x86_64.rpm

View user cat / etc / passwd
see the user group cat / etc / group
if the upgrade does not have permission, you need to run the command: yum -y install mysql-devel mysql -server mysql to change the permission settings. If no user group and user names need to be created: groupadd mysql useradd -g mysql mysql

5. After installing start mysql> service mysql start

Problems you might encounter: I was Centos system input service mysql restart
reported ERROR: MySQL server PID file could not be found error because selinux to blame, if the system is centos default will open selinux solution!: Close it
vi / etc / selinux / config
to SELINUX = enforcing to save and exit SELINUX = disabled after
reboot

6. Log

Check the initial password
cat /root/.mysql_secret
then copy the code at the end of
mysql -u root -p
prompt for a password
will enter> mysql state after a successful login

7, modify the MySQL database Password:

After a successful login, using the
set password = password ( "xxxxxx" );
Change Password

annex:

Guess you like

Origin blog.csdn.net/xiao_xiao_b/article/details/93249307