Installing databases in Linux the first version of the preferred Mysql,mysql database is distributed on Linux systems, and other options can be postgresql,oracle, etc.
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 for us, more convenient
See if you have your own MySQL database in your system
[Email protected] ~]# Rpm-qa | grep mysql//This command will check if the MySQL database is already installed on the operating system
Through this command to see if the system is already installed MySQL, you can see my system is relatively clean, not install any version of MySQL, if your system has installed, you can choose to uninstall
[[email protected] ~]# rpm-e mysql//normal delete mode [[email protected] ~]# rpm-e--nodeps MySQL//brute force Delete mode, if you use the above command to delete, prompted to have dependent on the other File, the command can be used to forcefully delete the
Two. Install MySQL using the yum command
[email protected] ~]# Yum List | grep MySQL
We can view the version of MySQL available for download on Yum by command
The database is then installed with the following command
[email protected] ~]# yum install-y mysql-server MySQL Mysql-deve
After waiting for some time, the output:
Indicates that the installation has been successful! Use the following command to view version information for the installed database
[Email protected] ~]# Rpm-qi mysql-server
Three. Initialization of MySQL database and related configuration
After we install the MySQL database, we will find a mysqld service, this is our database service, we can start our MySQL service by entering the service mysqld Start command.
Note : If we are starting the MySQL service for the first time, the MySQL server will first initialize the configuration, such as:
At this point we will see that the first time you start the MySQL server will prompt a lot of information, the purpose is to initialize the MySQL database, when we restart the MySQL service again, will not prompt so much information
When we use MySQL database, we have to start the Mysqld service first, we can check the MySQL service is started automatically by Chkconfig--list | grep mysqld command. If we find that the MYSQLD service does not start automatically, we can certainly set it to boot up with the chkconfig mysqld on command, so that it does not have to be started manually every time.
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, the first time the MySQL service started, the database will be some initialization work, in the output of a large string of information, we see a line of information:
We'll set the root user password as root based on this command.
At this point we can log in to our MySQL database via the mysql-u root-p command.
Four. mysql's main configuration information
1./etc/my.cnf This is the main configuration file for MySQL
2. Storage location of database files for/var/lib/mysql MySQL Database
Mysql,test is the two database that comes with MySQL database
Now let's go to MySQL command line to create a database try
3./var/log mysql database log output storage location
Where mysqld.log This file is the log information that is stored in our operation with the MySQL database, we can get a lot of information by viewing the log file.
We all know that the MySQL database binding port number is 3306, so we can use the netstat-anp command to see if the Linux system is listening to 3306 this port number:
Finally, let's learn some common commands for Linux under MySQL:
can refer to http://www.xxlinux.com/article/development/database/20121106/18532.html
Not to be continued ...
Installation and configuration of MySQL in CentOS (go)