Ubuntu Install MySQL Database

Source: Internet
Author: User

Briefly under Ubuntu Linux install MySQL database

One. Installation

# Apt-get Install Mysql-server
# Apt-get Install Mysql-client

Two. Start

# sudo start MySQL

Check to see if monitoring is established

# Netstat-tap | grep MySQL
TCP 0 0 Localhost:mysql *:* LISTEN 15910/mysqld

Three. To cancel native unique access restrictions

/ETC/MYSQL/MY.CNF file, note this sentence bind-address = 127.0.0.1

Four MySQL related commands

Go to MySQL Console

Mysql-uroot-p

Enter your password to log in

1. Create a database

mysql>create [database name];

2. Display Number Library

Mysql>show databases;

3. Using the Database

Mysql>use [database name];

4. Create a table

Please note: The upper left corner of the keyboard is Instead of single quotes '

Mysql>create TABLE ' Ud1 ' (
[->] ' uid ' INT (Ten) not NULL DEFAULT ' 0 ',
[->] ' intro ' TEXT NULL,
[->] PRIMARY KEY (' uid ')
[->]);

Note: Here is the SQL statement, the keyword has to be capitalized

5. Display table

->mysql>show tables

6. Querying the contents of the table

Mysql> select * FROM [table name];

Ubuntu Install MySQL Database

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.