MySQL Installation Guide under Ubantu

Source: Internet
Author: User

http://wiki.ubuntu.org.cn/MySQL%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97

Install MySQL

sudo apt-get install Mysql-server

This should be very simple, and I think everyone in the installation is not too much problem, so it is not much to say, the following we talk about configuration.

Configure MySQL

Note that the MySQL default in Ubuntu is only allowed for local access, if you want to be able to access other machines, then you need to change the/ETC/MYSQL/MY.CNF configuration file! Below we step by step:

The root user does not have a password after the default MySQL installation, so first use the root user to enter:

$mysql-U Root

Here the reason for using-u root is because I am now a general user (Firehare), if you do not add-u root, MySQL will assume that it is firehare log in. Note that I do not have access to root user mode here because it is not necessary. In general, the database in MySQL operation, there is no need to enter the root user mode, only in the setting of this possibility.

After entering MySQL, the most important thing is to set up the root user password in MySQL, otherwise, the MySQL service is not safe to say.

Mysql> GRANT All privileges on * * to [e-mail protected] identified by "123456";

Note that I use 123456 as the root user's password, but the password is not secure, please use a combination of uppercase and lowercase letters and numbers, and not less than 8 bits.

In this case, you set up the root user password in MySQL, and then use the root user to build the database you need. Here I take xoops as an example:

mysql>CREATE DATABASE xoops;

Mysql>GRANT All privileges the xoops.* to [e-mail protected] identified by "654321";

This establishes a xoops_roots user, which has full access to the database Xoops. After the use of Xoops_root to the Xoops database management, and no need to use the root user, and the user's permissions are only limited to the Xoops database.

If you want to do remote access or control, then you need to do two things:

One

Mysql>GRANT all privileges on xoops.* to [email protected] '% ' identified by ' 654321 ';

Allows xoops_root users to log in to MySQL from any machine.

Second:

$sudo gedit/etc/mysql/my.cnf

In the old version

>skip-networking = # skip-networking

In the new version

>bind-address=127.0.0.1 = bind-address= your machine's IP

This allows other machines to access MySQL.

Start the restart

In the startup management init.d the commands for MySQL are
/etc/init.d/mysql Start|stop|restart|reload|force-reload|status

Start
$sudo/etc/init.d/mysql Start
Shut down
$sudo/etc/init.d/mysql Stop

Restart

$sudo/etc/init.d/mysql Restart

MySQL Installation Guide under Ubantu

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.