How to install MySQL under Ubuntu

Source: Internet
Author: User

Objective

Because configuring the HQueue render cluster first requires MySQL to be installed, share today how to install it in Ubuntu;

Ubuntu installs the development class software is very convenient, does not need to go to MySQL and Apache's official website to download the file, because Ubuntu's software source already integrates the necessary package, obtains the installation directly with the command line ~

before installing MySQL, however, make sure that you have Apache installed, and if you do not have it installed, click View installation of Apache ;

  

MySQL installation process

First press Ctrl+alt+t to open the terminal;

Input sudo apt-get install Mysql-server

The following prompt appears by default:

  

Continue to scroll down and you'll see a hint: you need to download a 16.6-gigabit package that will consume 131 megabytes of space after decompression ~

The direct input y continues to be able to install the prompt to enter the password, must remember;

The initial command line is returned again when the installation is complete:

Now, MySQL server is installed ~ Next install Mysql-client, the same steps as above ~

Enter sudo apt-get install mysql-client Enter, you may be prompted not to read the source, just press the ↑ arrow to bring up sudo apt-get install mysql-client Press ENTER once until the following prompt appears: MYSQL-CL Ient is already the latest version can ~

  

Now verify that the installation is successful, enter sudo netstat-tap|grep MySQL

The installation succeeds if the following prompt appears:

  

Go to MySQL

Now it's completely ready to start MySQL ~

Input command: Mysql-u root-p

-U on behalf of the user name, where the root user login Mysql,-p on behalf of the password, enter after the prompt for the password, enter the password to install Mysql-server can ~

After successful login, a mysql> appears in the lower left corner waiting for you to enter a new command ~

Then you can use the show Database command to view the databases, with show tables to view the database form, you can also use INSERT, delete, select, update the operation of adding and deleting, the specific usage is as follows:

Add record: INSERT into table name (field name, field name) values (value, value);

Delete Record: Delete from table name WHERE condition (can not be from in oracal)

Modify record: UPDATE table name SET field = value, field = value where condition

Query record: SELECT field, field from table name WHERE condition

  

Start MySQL

Now let's talk about how to start the MySQL service:

In terminal input: sudo service MySQL start

You can also start with a script:/etc/inint.d/mysql start

If you stop typing: sudo service mysql stop

MySQL restart: sudo service mysql restart

  

Installation of Apache

Running the render cluster requires a service side, Apache is the best service side;

Installation method like MySQL, in terminal input sudo apt-get install apache2

Apache2 is currently available in the latest version ~

After installation, enter ls/var/www/html in the terminal.

You can see that there is a index.html file under the directory;

Now open the browser, enter localhost or 127.0.0.1 to see the following welcome page:

apache2! Ubuntu Exclusive Custom Version! ha! It works!

   

Feel this welcome page is more beautiful than the default page installed under Windows Apache boot-hehe;

Remember 07 junior, teach us Java Software Engineering instructor Chandavi teacher, teach us how to configure Apache and MySQL, Jin teacher said very carefully, then do a moment to configure, then the Apache service side of the localhost page bounce out, At the top is a very abstract little tiger;

Click here to return to view MySQL installation;

OK, Apache and MySQL installation method sharing is complete.

How to install MySQL under Ubuntu

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.