Install MySQL in Ubuntu

Source: Internet
Author: User

The usual, ctrl+alt+t exhale terminal,

Input

sudo apt-get update

Update the source, or run the following code will be reported that a few packages can not be downloaded, you still have to come back to execute this code,

Input

sudo apt-get install mysql-server mysql-client

Note You will be prompted to enter your password during the execution of this code, which is the password for your database,

Input

sudo service MySQL restart

Restart the MySQL database, if the success of the installation is successful, otherwise, you understand, failed ...

Input

sudo apt-get install Libapache2-mod-auth-mysql

Let Apache support MySQL database

Input

Mysql-u root-p

Log in to the database, the password is the password set when the database was previously installed

Input

CREATE DATABASE ' project ' CHARACTER SET ' utf8 ' COLLATE ' utf8_general_ci ';

Create a database called Project and specify the character set as Utf-8 (otherwise the input character will be an error)

Input

CREATE TABLE login (username char) not Null,password char (+) not Null,id INT (a) NOT NULL Auto_increment,primary key (i d));

Create a data table named login and specify the ID as the primary key, specifying the data table character set as Utf-8;

show databases;   View Database
Show tables; View Data Sheet

 

Of course, the use of terminal operation is often too cumbersome, so the third-party visualization software appears, such as: Mysql-workbench;

Input

sudo apt-get install Mysql-workbench

Install a third-party plugin, of course, in English, I try to set Simplified Chinese in Configure Fonts for, Preference, appearance, edit,

But it doesn't work.

--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------

As for how to use, I believe that smart you can get started with a look;

 

Install MySQL in Ubuntu

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.