About mysql startup --- mysqld_safe mysqld from pid file * ended,

Source: Internet
Author: User

About mysql startup --- mysqld_safe mysqld from pid file * ended,

Let me first talk about how to install mysql:

1. At the beginning, installing mysql is a software package that can be decompressed. I decompress it, copy it to the/usr/local/directory, and name it mysql.

2. Create a user mysql. [Root @ localhost ~] # Useradd mysql

3. Modify permissions. [Root @ localhost ~] # Chown-R mysql: mysql/usr/local/mysql

4. initialize mysql. Go to the/usr/local/mysql/directory under the/usr/local/mysql/scripts/directory and have an executable mysql_install_db file. Run/usr/local/mysql/scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data & (this is very important)

If you do not run the red font, an error may occur:

Fatal error: cocould not find./bin/my_print_defaults

If you compiled from source, you need to run 'make install'

Copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top

Level of the extracted archive, or pass the -- basedir option

Pointing to that location.

5. Start the mysql service. Run [root @ localhost ~] #/Usr/local/mysql/bin/mysqld_safe

120223 21:42:59 mysqld_safe Logging to '/usr/local/mysql/data/localhost. localdomain. err '.
Chown: the operand is missing after "/usr/local/mysql/data/localhost. localdomain. err"
Run "chown -- help" to obtain more information.
120223 21:42:59 mysqld_safe Starting mysqld daemon with databases from/usr/local/mysql/data

A similar prompt indicates that the instance is successfully started.

Idea: this error may occur.

Mysqldump: error while loading shared libraries: libmysqlclient. so.16: cannot open shared object file: No such file or directory

The solution is:

1. Check whether the libmysqlclient. so.16 file exists.

[Root @ localhost ~] # Find \-name libmysqlclient. so.16

2. If yes. Create a soft connection.

Ln-s/usr/local/mysql/lib/libmysqlclient. so.16/usr/lib/idea: if the system is 64bit, it is:

Ln-s/usr/local/mysql/lib/libmysqlclient. so.16/usr/lib64/

 

In fact, I have not mentioned any issues that need to be discussed.

Somehow, the mysql I installed does not have the my. cnf file under/etc.

A my. cnf file is copied for testing. Run the command again to report this problem.

[Root @ localhost ~] #/Usr/local/mysql/bin/mysqld_safe
120223 21:29:59 mysqld_safe Logging to '/usr/local/mysql/data/localhost. localdomain. err '.
Chown: the operand is missing after "/usr/local/mysql/data/localhost. localdomain. err"
Run "chown -- help" to obtain more information.
120223 21:29:59 mysqld_safe Starting mysqld daemon with databases from/usr/local/mysql/data
120223 21:29:59 mysqld_safe mysqld from pid file/usr/local/mysql/data/localhost. localdomain. pid ended

I checked a lot of information on the Internet, but this was not my case. Later I was able to help you to delete two files under/usr/local/mysql/data.

Ib_logfile0 and ib_logfile1

Finally, solve the problem (I have been busy with writing and I will sort out some of the problems I encountered recently). Please also point out

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.