Centos6.5 use yum to install mysql-Quick Start

Source: Internet
Author: User

Step 2. Install mysql in yum
[Root @ stonex ~] # Yum-y install mysql-server
Installation result:
Installed:
Mysql-server.x86_64. 1.73-3. el6_5
Dependency Installed:
Mysql. x86_64. 1.73-3. el6_5 perl-DBD-MySQL.x86_64. 013-3.el6 perl-DBI.x86_64. 609-4.el6

Step 2. Set startup
[Root @ stonex ~] # Chkconfig mysqld on

Step 2. Start the MySql Service
[Root @ stonex ~] # Service mysqld start

Step 2: Set the password for the root user of MySQL
[Root @ stonex ~] # Mysql-u root
Welcome to the MySQL monitor. Commands end with; or \ g.
Some rows are omitted.
Mysql> select user, host, password from mysql. user;
The query password is empty. Use the following command to set the root password to root.
Mysql> set password for root @ localhost = password ('root ');
Mysql> exit

Step 2. log in with a new password
[Root @ stonex ~] # Mysql-u root-p

Step 2: Basic commands
Show databases; // view the existing database of the system
Use databasesname; // select the database to use
Drop database databasename; // Delete the selected database
Exit // exit the database connection
Create database test01; // create a database named test
Show tables; // list the tables in the current database
Use standard SQL for other basic addition, deletion, modification, and query

(End)

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.