How to install Mysql in Ubuntu _ MySQL

Source: Internet
Author: User
How to install Mysql in Ubuntu

BitsCN.com
Installing MySQL sudo apt-get install mysql-server should be simple, and I don't think there is much problem with installation, so I will not talk about it much. let's talk about the configuration below. Configure MySQL. Note that in Ubuntu, MySQL only allows local access by default. if you want access from other machines, change/etc/mysql/my. cnf configuration file! Next we will step by step: after the default MySQL installation, the root user has no password, so first use the root user to enter: $ mysql-u root here uses-u root because I am a general user (firehare). if-u root is not added, mysql will assume that it is a firehare login. Note: I have not entered the root user mode here because it is unnecessary. In general, it is not necessary to enter the root user mode to operate the database in mysql. this is only possible when the database is set. After entering mysql, the most important thing is to set the root user password in Mysql. Otherwise, the Mysql service is no longer secure. Mysql> grant all privileges on *. * TO root @ localhost identified by "123456"; note that I use 123456 as the root user password, but this password is not safe, it is recommended that you use a password consisting of uppercase and lowercase letters and numbers, with no less than 8 characters. In this case, the root user password in MySQL is set up, and then the database you need is created with the root user. Here we will take xoops as an example: mysql> create database xoops; mysql> grant all privileges on xoops. * TO xoops_root @ localhost identified by "654321"; in this way, a xoops_roots user is created, which has all permissions on the database xoops. In the future, we will use xoops_root to manage the xoops database, instead of using the root user. this user's permissions will only be limited to the xoops database. If you want to implement remote access or control, you have to do two things: mysql> grant all privileges on xoops. * TO xoops_root @ "%" identified by "654321"; allows the xoops_root user TO log on TO MySQL from any machine. Second: $ sudo gedit/etc/mysql/my. in the old cnf version,> skip-networking => # in the new version of skip-networking> bind-address = 127.0.0.1 => bind-address = your machine's IP address so that you can allow other the machine has accessed MySQL. Author: MyEyeOfJavabitsCN.com

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.