Install and configure mysql in ubuntu

Source: Internet
Author: User
Tags mysql commands

Ubuntu installation and configuration mysql this article only introduces the simplest and most basic installation and configuration methods 1. install [plain] sudo apt-get install mysql-server during installation, the mysql password is set interface, enter the password and click OK. Check whether the installation is successful: Enter the command netstat-tap | grep mysql to check whether the mysql service exists. This indicates that the installation is successful. 2. Configure 2.1 to enable remote access to mysql only through local access (127.0.01) by default. Remote Access is not allowed. The enabling method is [plain] sudo gedit/etc/mysql/my. cnf open the mysql configuration file and comment out bind-address = 127.0.0.1. 2.2 set the mysql character set to utf8 and log on to mysql first (assuming my mysql password is 1234) [plain] mysql-uroot-p1234 use the command: show variables like 'character % '; check the character encoding added in [client] and [mysql: character-set-server = utf8 save. Restart mysql: sudo restart mysql describes several common mysql commands I. database operation 1. create database Command: create database <database Name> example: create a database mysql> create database test; 2. Display All database commands: show databases mysql> show databases; 3. delete a database command: drop database <database Name> example: Delete the database mysql named test> drop database test; 4. Connect to the database command: use <database Name> example: if the database test exists, try to access it: mysql> use test; on-screen prompt: Database changed5, view the currently used database mysql> select Database (); 6. Table information contained in the current database: mysql> show tables;

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.