Mysql installation Configuration Method Tutorial _mysql

Source: Internet
Author: User
Tags mysql client mysql download

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 for connecting and operating 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 the baseline and performance testing tools for the database server.
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 mysql rpm package, download the address for: MySQL download.

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.

Third, 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.

four , 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  |
|
+----------+
2 rows in Set (0.13 sec)

Five, 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.

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.

The above is the entire content of this article, I hope to help you learn.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.