Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of restarting MySQL Database under linux

Shulou Source: shulou.com Published: 2022-05-31 23:09:10 09月15日 Update

This article will explain in detail how to restart the MySQL database under linux. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

The Mysql installed from the program installation package does not have the servcie mysqld restart script commonly used by Red Hat in the system, so restart the MYSQL database

Have to restart manually, directly execute Killall mysql, forced termination, may cause table damage, once caused table damage, the loss is huge.

A safe restart method is recommended here

$mysql_dir/bin/mysqladmin-u root-p shutdown

$mysql_dir/bin/safe_mysqld &

Mysqladmin and mysqld_safe are located in the bin directory of the Mysql installation directory and are easy to find.

Restart MySQL service under windows

For users who do not have the mysql graphical management side installed, start and stop the mysql service:

... \... \ bin > net stop mysql

... \... \ bin > net start mysql

How to start / stop / restart MySQL

Starting, stopping and restarting MySQL is an operation that must be supported by every webmaster who owns a VPS or independent server.

The following is a brief introduction to the method of operation:

I. start-up mode

1. Use service to start:

Service mysqld start

2. Use the mysqld script to start:

/ etc/inint.d/mysqld start

3. Use safe_mysqld to start:

Safe_mysqld&

2. Stop

1. Use service to start:

Service mysqld stop

2. Use the mysqld script to start:

/ etc/inint.d/mysqld stopmysqladmin shutdown

3. Restart

1. Use service to start:

Service mysqld restart

2. Use the mysqld script to start:

/ etc/inint.d/mysqld restart

Database MySQL uses functions to open, close, and view functions. You may encounter this kind of error when running mysql, as shown in the following code:

ERROR 1418: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you * might* want to use the less safe log_bin_trust_function_creators variable)

This is because the MYSQL database is not open. Execute the following code to turn it on:

SET GLOBAL log_bin_trust_function_creators=1

Similarly, the code to turn off the mysql function is:

SET GLOBAL log_bin_trust_function_creators=0

So what's the code to check the status of mysql? The code is as follows:

This is the end of the show variables like'% func%'; article on "how to restart the MySQL database under linux". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Data databases methods code scripts articles services functions more directories good practical huge security content functions graphics that is commonly used Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Apple MySQL Redmi Shulou Information