Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation layout of Ubuntu mysql server

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the installation layout of Ubuntu mysql server". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the installation layout of Ubuntu mysql server.

Ubuntu mysql installation layout:

/ usr/bin client program and mysql_install_db

/ db database and log files

/ var/run mysqld server

/ etc/mysql mysql profile my.cnf

/ usr/share/mysql character set, benchmark and error messages

/ etc/init.d/mysql start the mysql server

Set the Ubuntu mysql server to start and shut down automatically with the switch:

System-> system Management-> Service

When you get to the Service Settings window, activate the mysql database service

Modify the storage directory of the Ubuntu mysql database file:

Suppose we specify a database file directory of / db

1. Create the directory / db, and change its owner and group to mysql:mysql. Command: chown mysql:mysql db

two。 Turn off the mysql database service: mysqladmin-u root-p shutdown

3. Modify the Ubuntu mysql configuration file my.cnf: change datadir=/var/lib/mysql to datadir=/db

4. Reinitialize the data file: execute mysql_install_db

5. Start the Ubuntu mysql database service: sudo / etc/init.d/mysql start

6. Set the root password for mysql database: mysqladmin-u root password' new-password'

At this point, we will find the 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 mysql database file storage directory we modified is correct.

Configure the INNODB storage engine for the Ubuntu mysql database:

1. Check the Ubuntu mysql storage engine: log in to the mysql database and get the show engines; command at the mysql > prompt. Found: InnoDB | YES, indicating that this mysql database server supports InnoDB engine.

two。 Set InnoDB as the default engine: add the sentence default-storage-engine=INNODB under [mysqld] in the configuration file my.cnf and save it.

3. Restart the Ubuntu mysql server: mysqladmin-u root-p shutdown (enter), sudo / etc/init.d/mysql start (enter).

4. Log in to the mysql database and get the show engines; command at the mysql > prompt. If InnoDB | DEFAULT appears, it means that we successfully set InnoDB as the default engine.

Ps: here I used the restart command sudo / etc/init.d/mysql restart and got an error message, so I used the stupid method of shutting down the service and starting it again in step 3 above.

At this point, I believe that everyone on the "Ubuntu mysql server installation layout" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report