Ubuntu MySQL Database installation

Source: Internet
Author: User

install the MySQL server side using the following three commands, respectively, and the client
 
   
  
  1. sudo apt-get install mysql-server
  2.  
  3. sudo apt-get isntall mysql-client
  4. sudo apt-get install libmysqlclient-dev
During installation, you will be prompted to set a password or something, note that the settings do not forget that after the installation is complete, you can use the following command to check if the installation is successful:
Check if the installation was successful
 
   
  
  1.  netstat -tap | grep mysql
after the above command is checked, if you see a socket with MySQL in the Listen state, the installation is successful.
The MySQL database can be used with the following commands:
 
   
  
  1. mysql -u root -p
- u means to select the login user name,-p indicates the login user password, the above command input will prompt for a password, then enter the password can log in to MySQL.

Create a database First MySQL entry: gbk:create database test2 DEFAULT CHARACTER SET GBK COLLATE gbk_chinese_ci; Utf8:create DATABASE ' test2 ' DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci; eg:[[email protected] test]# Mysql-u Root-penter Password:welcome to the MySQL monitor.  Commands end with; or \g.your MySQL connection ID is 5Server version:5.1.30-community mysql community Server (GPL) Type ' help; ' or ' \h ' for H Elp. Type ' \c ' to clear the buffer.mysql> CREATE DATABASE ' test ' DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci; Query OK, 1 row affected (0.06 sec) mysql> show databases;+--------------------+| database           |+--------------------+| Information_schema | | cacti              | | mysql              | | test               |             |+--------------------+5 rows in Set ( 0.07 sec) This test library is in utf-8 format.


From for notes (Wiz)

Ubuntu MySQL Database installation

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.