Install MySQL under Ubuntu 14.10

Source: Internet
Author: User

1 Installing the server

sudo apt-get install Mysql-server

2 Installing the Client

sudo apt-get install mysql-client
sudo apt-get install Libmysqlclient-dev

The installation process needs to set the user name password, do not forget

3 Check if there is a MySQL service in the system, the following is probably the success

Netstat-tap|grep MySQL
TCP        0      0 *:mysql                 *:*                     LISTEN      

4 Simple configuration

4.1 Set the database encoding to open the configuration file my.cnf

sudo nano/etc/mysql/my.cnf

Modify the following location

[Client]port            = 3306socket          =/var/run/mysqld/mysqld.sock# increases the character encoding of the client Default-character-set=utf8
[Mysqld] #增加服务器端的字符编码character-set-server=utf8collation-server=utf8_general_ci

4.2 Let the server remotely access or configure the file my.cnf

#注释bind-address#bind-address            = 127.0.0.1

4.3 Initializing the root password

Set = password ("root");

5 Introduction to Common commands

5.1 Login to the database,-u followed by the user name, enter after entering the password can be

1 mysql -u root -p

5.2 Viewing the database character set

Show variables like ' character% ';

5.3 Creating a Database

Create databases < database name >

5.4 Show All databases

show databases;

5.5 Deleting a database

Drop databases < database name >

5.6 Linked databases

Use < database name >

5.7 Viewing the currently used database

Select Database ()

5.8 View current database table information

Show tables

5.9 Exit

Exit

1 SET PASSWORD =&NBSP; password (" root ");

Install MySQL under Ubuntu 14.10

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.