MySQL download address for all platforms: MySQL download. Select the MySQL Community Server version you need and the corresponding platform.
First, install MySQL on Linux/unix
The Linux platform recommends the use of the RPM package to install Mysql,mysql AB provides the following RPM package download address:
MySQL -MySQL server. You need this option unless you only want to connect to a MySQL server running on another machine.
mysql-client -MySQL client program, used to connect and operate the MySQL server.
Mysql-devel -Libraries and include files, if you want to compile other MySQL clients, such as the Perl module, you need to install the RPM package.
mysql-shared -This package contains a shared library (libmysqlclient.so*) that some languages and applications need to dynamically load, using MySQL.
mysql-bench -MySQL database server benchmarks and performance testing tools.
The following instance of installing the MySQL RMP is done on the SUSE Linux system, which is also suitable for other Linux systems that support RPM, such as: Centos.
The installation steps are as follows:
Log on to your Linux system using root user.
Download the MySQL RPM package.
Use the following command to perform MySQL installation, RPM package for you to download the RPM package:
[root@host]# rpm-i mysql-5.0.9-0.i386.rpm
the process of installing the MySQL server above will create a MySQL user and create a MySQL profile my.cnf.
You can find all the MySQL-related binaries in/usr/bin and/usr/sbin. All data tables and databases will be created in the/var/lib/mysql directory.
Here are some MySQL optional package installation process, you can install according to your own needs:
[root@host]# rpm-i mysql-client-5.0.9-0.i386.rpm
[root@host]# rpm-i mysql-devel-5.0.9-0.i386.rpm
[ root@host]# rpm-i mysql-shared-5.0.9-0.i386.rpm
[root@host]# rpm-i mysql-bench-5.0.9-0.i386.rpm
Second, install MySQL on Windows
Installing MySQL on Windows is relatively straightforward, and you only need to download the Windows version of the MySQL installation package in the MySQL download and unpack the installation package.
Double-click the Setup.exe file, next you only need to install the default configuration click "Next", by default the installation information will be in the C:\mysql directory.
Next you can enter the "cmd" command in the search box by "start" = "Switch to the C:\mysql\bin directory at the command prompt, and enter the command:
Mysqld.exe--console
If the installation succeeds the above command will output some MySQL startup and InnoDB information.
1, verify the MySQL installation
After the MySQL is successfully installed, some of the underlying tables are initialized, and after the server is started, you can verify that MySQL is working properly with a simple test.
Use the Mysqladmin tool to obtain server status:
Use the mysqladmin command to check the server's version on Linux, where the binaries are located on Linux in/usr/bin on Windows, where the binaries are located in C:\mysql\bin.
[root@host]# mysqladmin--version
On Linux the command will output the following results based on your system information:
Mysqladmin Ver 8.23 distrib 5.0.9-0, for Redhat-linux-gnu on i386
If the above command does not enter any information after execution, your MySQL is not installed successfully.
2, the use of MySQL client (MySQL clients) to execute a simple SQL command
You can connect to the MySQL server by using MySQL command on MySQL client (MySQL clients), by default the MySQL server password is empty, so this example does not need to enter a password.
The order is as follows:
[root@host]# MySQL
The above command outputs the mysql> prompt, indicating that you have successfully connected to the MySQL server and that you can execute the SQL command at the mysql> prompt:
Mysql> show DATABASES;
+----------+
| Database |
+----------+
| mysql |
| Test |
+----------+
2 rows in Set (0.13 sec)
3, MySQL installed after the need to do
After the MySQL installation is successful, the default root user password is blank, and you can create the root password by using the following command:
[root@host]# mysqladmin-u root password "new_password";
Now you can connect to the MySQL server with the following command:
[root@host]# mysql-u Root-p
Enter password:*******
Note: When you enter a password, the password is not displayed, you can enter it correctly.
4. Start MySQL when Linux system starts
If you need to start the MySQL server at the start of the Linux system, you need to add the following command to the/etc/rc.local file:
/etc/init.d/mysqld start
again, you need to add the mysqld binaries to the/etc/init.d/directory.
Wonderful topic sharing: MySQL different versions of the installation Tutorials mysql5.7 version Installation Tutorials
The above is the entire content of this article, I hope to help you learn.