Linux environment installation MySQL

Source: Internet
Author: User

Install Virtual machine: Redhat+centos

I said slightly will not be beaten, haha, the installation of this virtual machine after I make up the bar ~ ~

    • First look at the MySQL-related packages that have been installed
Rpm-qa | grep MySQL

The following results occur after execution, but this is only a toolkit that comes with MySQL, which is not actually installed

In the CentOS6.9 with Yum can be installed, mainly behind some of the configuration

    • So let's take a look at Yum-installable MySQL-related packages
Yum List | grep ^mysql

You can see that Yum provides the following MySQL installation package, we need is red box logo two modules, server and client, only install these two, related dependent package Yum will automatically install

    • The next step is to install, execute the following command, the process may need to make a few choices, always select Y to
Yum Install Mysql-devel Mysql-server
    • To verify that the installation was successful, remember the RPM command that was first mentioned ~ ~
Rpm-qa | grep MySQL

The discovery has been installed successfully

    • Next you can start MySQL
Service mysqld Start

See, this note started successfully.

    • Then you can now connect to the database to operate ~ ~ ~
Mysql-uroot-p

It means to connect to the database with the root account, enter the password after entering the prompt, the initial password is empty, so directly return to the following interface, you can execute SQL

show databases;

Here the database is installed, but it is recommended that we do some follow-up to facilitate the future

    • Modify the encoding set, the proofing set, and the storage engine for the database, and enter the following command at the command line of MySQL
 like ' %char% '  like'%colla%';
Show variables like '%engin% '

The result is that I have changed the results of the configuration file, if you find that you have found the results and not always, then to modify the configuration file

    • Modify the MySQL configuration file and restart the service, the configuration file is in the/etc/directory
/etc/my.cnf

Add the following code to the location shown in the figure, then save it, save it as ESC and enter: WQ

character-set-server=utf8collation-server=utf8_general_cidefault-storage-engine=INNODB[ Client]default-character-set=utf8

Restart Service

Service mysqld Restart

See the following interface to show that the restart was successful

The SQL that can be executed before viewing the encoding set should see that it has been set in the configuration file ^_^

Linux environment installation MySQL

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.