MySQL installation method, mysql Installation Method

Source: Internet
Author: User
Tags mysql download

MySQL installation method, mysql Installation Method

For Mysql on all platforms: Download MySQL. select what you needMySQL Community ServerVersion and corresponding platform.

  Install Mysql on Linux/UNIX

On Linux, we recommend that you use the RPM package to install Mysql. MySQL AB provides the following RPM packages:

  • MySQL-MySQL server. You need this option unless you only want to connect to the MySQL server running on another machine.
  • MySQL-client-The MySQL client program is used to connect to and operate the Mysql server.
  • MySQL-devel-Library and inclusion files. If you want to compile other MySQL clients, such as the Perl module, you need to install this RPM package.
  • MySQL-shared-This package contains the Shared Library (libmysqlclient. so *) That must be dynamically loaded by some languages and applications, using MySQL.
  • MySQL-connector-MySQL database server benchmark and performance testing tools.

The following is an example of installing Mysql RMP on SuSE Linux. Of course, this installation step is also suitable for other Linux systems that support RPM, such as Centos.

The installation procedure is as follows:

Log on to your Linux system as the root user.

Download the Mysql RPM package: MySQL download.

Run the following command to install Mysql:

[root@host]# rpm -i MySQL-5.0.9-0.i386.rpm

The above process creates a mysql user and creates a mysql configuration file my. cnf.

You can find all MySQL-related binary files in/usr/bin and/usr/sbin. All data tables and databases will be created in the/var/lib/mysql directory.

The following is the installation process of some optional mysql packages. you can install them as needed:

[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
  Install Mysql on Window

Windows is relatively easy to install Mysql. You only need to download the Windows MySQL installation package and decompress the installation package.

Double-click the setup.exe file. next you only need to install the default configuration and click "next". By default, the installation information will be in the C: \ mysql directory.

Next, you can enter "cmd" command = "in the search box and switch to the C: \ mysql \ bin directory at the command prompt, and enter the following command:

mysqld.exe --console

If the installation is successful, the above commands will output some mysql startup and InnoDB information.

  Verify Mysql Installation

After Mysql is successfully installed, some basic tables are initialized. After the server is started, you can test it to verify that Mysql works properly.

Use the mysqladmin tool to obtain the server status:

Run the mysqladmin command to check the server version. on linux, the binary file is located in/usr/bin on linux and the binary file is located in C: \ mysql \ bin on window.

[root@host]# mysqladmin --version

On linux, the command will output the following results, which are based on your system information:

mysqladmin  Ver 8.23 Distrib 5.0.9-0, for redhat-linux-gnu on i386

If no information is entered after the preceding command is executed, your Mysql installation is successful.

  Use MySQL Client to execute simple SQL commands

You can use the MySQL command on the Mysql Client to connect to the mysql server. By default, the password of the Mysql server is blank, so you do not need to enter a password for this instance.

The command is as follows:

[root@host]# mysql

After the preceding command is executed, the mysql> prompt is output, indicating that you have successfully connected to the Mysql server. You can run the SQL command at the mysql> prompt:

mysql> SHOW DATABASES;+----------+| Database |+----------+| mysql    || test     |+----------+2 rows in set (0.13 sec)
  What needs to be done after Mysql Installation

After Mysql is successfully installed, the default root user password is blank. You can use the following command to create a root user password:

[root@host]# mysqladmin -u root password "new_password";

Now you can use the following command to connect to the Mysql server:

[root@host]# mysql -u root -pEnter password:*******

Note:When you enter the password, the password will not be displayed. You can enter it correctly.

  Start MySQL at Linux Startup

If you need to start the MySQL server at Linux Startup, you need to add the following command in the/etc/rc. local file:

/etc/init.d/mysqld start

Similarly, you need to add the mysqld binary file to the/etc/init. d/directory.

 

Address: http://www.manongjc.com/mysql/mysql_install.html

Read about mysql:

Use and Analysis of mysql ORD () and ASCII () Functions

Introduction to using MySQL ORD () Functions

The MySQL ASCII () function returns the ASCII value of a character.

Mysql TRUNCATE () function instance

Mysql SIGN (x) determines whether the number x is positive or negative.

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.