Installing MySQL in the CentOS environment
To install MySQL database on Linux, we can download the MySQL database rpm package on its official website, Http://dev.mysql.com/downloads/mysql/5.6.html#downloads, You can download the corresponding database files according to your own operating system. Here I am the installation of MySQL database through Yum, this way to install, can be related to MySQL some services, jar packages are installed to us, so save a lot of unnecessary trouble!!! I. Uninstall MySQL to see if the MySQL database is already installed on the operating system: We uninstall MySQL by rpm-e command or RPM-E--nodeps command (//normal Delete mode//brute force Delete mode, if you use the above command to remove the If you are prompted for other files that you depend on, you can use this command to delete them forcefully after the deletion we can pass Rpm-qa | grep mysql command to see if MySQL has been uninstalled successfully. Two. Install MySQL via yum we are using Yum List | grep mysql command to view the downloadable version of the MySQL database available on Yum:
Then we can install the MySQL mysql-server mysql-devel by entering the Yum install-y mysql-server mysql mysql-devel command (note: When we installed MySQL, we didn't install the MySQL client, which was the equivalent of installing the MySQL database, and we needed to install the Mysql-server server. Yum will help us choose the software needed to install the MySQL database as well as some other ancillary software: Package Mysql-server not found, install mariadb-server instead of Mysql-server:
Start mariadb: Change password: MySQL database after installation will only have a root administrator account, but at this time the root account has not set a password for it, we through the command: MySQL admin-u root password ' new-password ' To set the password for our root account (Note: This root account is the root account of MySQL, not the root account of Linux) at this point we can log in to our MySQL database by mysql-u root-p command three. MARIADB configuration file 1./etc/my.cnf This is the MARIADB master profile 2./var/lib/mysql The database file where the MySQL database is stored the database file for our MySQL database is usually stored in the/ver/lib/ MySQL This directory we can create a database, to verify the location of the database files: 3./var/log mysql database log output storage location of our MARIADB database, some of the log output is stored in the/var/ Log this directory under the MARIADB package is stored under the Mariadb.log, this file is we store with MARIADB database to operate and generate some of the log information. Because our MySQL database is accessible over the network, not a stand-alone database, where the protocol used is the TCP/IP protocol, we all know that the MySQL database binding port number is 3306, so we can see through the NETSTAT-ANP command, is the Linux system listening on the 3306 port number:
Installing MySQL in the CentOS environment