Simple configuration scheme for MySQL database under Ubuntu

Source: Internet
Author: User

The following articles mainly introduce the simple configuration of the MySQL database under Ubuntu, including the correct installation layout of MySQL under ubuntu and the modification of the storage directory of MySQL database files, the following describes the specific content of the article.

1). MySQL installation layout in ubuntu:

/Usr/bin client program and MySQL_install_db

/Db database and log files (custom)

/Var/run MySQLd Server

/Etc/MySQL configuration file my. cnf

/Usr/share/MySQL Character Set, baseline program and error message

/Etc/init. d/MySQL start MySQL Server

2) modify the storage directory of MySQL database files:

Assume that the specified database file directory is/db.

1. Create a directory/db and change its owner and group to MySQL: MySQL. Command: chown MySQL: MySQL db

2. Disable MySQL Database Service: MySQLadmin-u root-p shutdown

3. Modify MySQL configuration file my. cnf: Change datadir =/var/lib/MySQL to datadir =/db

4. reinitialize the data file: Execute MySQL_install_db

5. start MySQL Database Service: sudo/etc/init. d/MySQL start

6. Set the MySQL Database root password: MySQLadmin-u root password 'new-password'

At this time, we will find MySQL-related files in the/db directory. If we create a new database, its database files will also appear in the db directory. Indicates that the file storage directory of the MySQL database we modified is correct.

 

The above content is an introduction to the simple configuration of MySQL database in Ubuntu. I hope you will get some benefits.

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.