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

A brief Analysis of the Operation process of starting mysql Database

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

The following content mainly brings you a brief analysis of the operation process of starting mysql database. The knowledge mentioned here, which is slightly different from books, is summarized by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing. I hope to bring help to the majority of readers.

{mysql} indicates the directory where mysql is installed

How to start / stop / restart MySQL

I. start-up mode

1. Start with service: service mysqld start

2. Start with mysqld script: / etc/inint.d/mysqld start

If you can't find mysqld under / etc/inint.d/, you can go to the mysql installation directory, {mysql} / init.d/mysqld start

3. Start with safe_mysqld: safe_mysqld&

2. Stop

1. Start with service: service mysqld stop

2. Start with mysqld script: / etc/inint.d/mysqld stop

If you can't find mysqld under / etc/inint.d/, you can go to the mysql installation directory, {mysql} / init.d/mysqld stop

3 、 mysqladmin shutdown

3. Restart

1. Start with service: service mysqld restart

2. Start with mysqld script: / etc/inint.d/mysqld restart

If you can't find mysqld under / etc/inint.d/, you can go to the mysql installation directory, {mysql} / init.d/mysqld restart

Editor's summary of questions

How to start / stop / restart MySQL

I. start-up mode

1. Start with service: service mysqld start

2. Start with mysqld script: / etc/inint.d/mysqld start

3. Start with safe_mysqld: safe_mysqld&

2. Stop

1. Start with service: service mysqld stop

2. Start with mysqld script: / etc/inint.d/mysqld stop

3 、 mysqladmin shutdown

3. Restart

1. Start with service: service mysqld restart

2. Start with mysqld script: / etc/inint.d/mysqld restart

When I first started learning mysql, I used redhat to bring it with me. What is startup / rc.d/init.d/ start

This is very simple, but later more and more, the system comes with mysql, some versions are too low, some are related to

The lower version of mysql required by the web service you want to install

Later, I learned to install mysql in the way of tar, and my mysql was installed in the / usr/local/mysql directory.

I have encountered a lot of problems in moving. The most common ones are:

ERROR 2002: Can't connect to local MySQL server through socket

'/ tmp/mysql.sock' (111)

Solution:

[root@test mysql] # / usr/local/mysql/bin/mysqladmin-u root /

>-S / var/lib/mysql/mysql.sock password 'your.passwd'

Or make a connection.

Ln-s / var/lib/mysql/mysql.sock / tmp

In fact, the prompt can not find / tmp/mysql.sock, sometimes it is not / tmp directory does not have this file, it is started

The orders are wrong. I've come across them.

Several common startup methods, I do not remember very clearly, if you are sure that there is a mysql.sock under tmp

Try a few other commands for a file

/ usr/local/mysql/bin/mysql-u root-p

/ usr/local/mysql/bin/mysqld-- user=mysql&

/ usr/local/mysql/bin/mysqld-- user=root&

/ usr/local/mysql/bin/mysqld_safe-- user=root&

/ usr/local/mysql/bin/mysqld_safe-- user=mysql&

/ usr/local/mysql/bin/safe_mysqld--uer=root& (note that safe_mysqld is different from mysqld_safe & it means that mysql is running in the background) I will make a mistake.

STOPPING server from pid file

/ usr/local/mysql/data/localhost.localdomain.pid

060304 11:46:21 mysqld ended

This is a question of permissions. My mysql directory belongs to both root users and root groups. It's no problem to start with mysqld_safe instead.

You just need to pay attention to these mysql,safe_mysqld,mysqld_safe,mysqld,mysqladmin. Multi-try

Several times

In fact, sometimes mysql has been started normally. Check to see if mysql starts the command.

Ps-aux | grep mysqld

You will see something similar to the following

Mysql 6394 0.0 1.5 10528 992 pts/3 S 16:16 0:00

/ usr/local/mysql/

Mysql 6395 0.0 1.5 10528 992 pts/3 S 16:16 0:00

/ usr/local/mysql/

Mysql 6396 0.0 1.5 10528 992 pts/3 S 16:16 0:00

/ usr/local/mysql/

Root 6422 0.0 1.1 2408 732 pts/3 S 16:20 0:00 grep

Mysql

Check to see if mysql is listening for port commands

Netstat-tl | grep mysql

You will see something similar to the following

Tcp 0 0 *: mysql *: * LISTEN

Related tutorials: mysql Video tutorial Linux Video tutorial

The above are the details of starting the mysql database operation under the linux system, please pay attention to other related articles!

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

Database

Wechat

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

12
Report