Configuration of MySQL Databases in Ubuntu

Source: Internet
Author: User
1). MySQL installation layout in Ubuntu:/usr/bin client program and mysql_install_db/db & nbs

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.

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.