Notes on MySQL installation under Fedora Core7

Source: Internet
Author: User

It is important to install MySql in a compressed package. In Windows, it is easy to decompress. Zip directly (Windows permission management is really weak -- | ). However, unzipping .tar.gz via coreora core7cannot be started. However, I started the installation process from the official MySQL documentation:

I. Preparations
1. Add a logon user and group for mysqld:

Shell> groupadd mysql

Shell> useradd-g mysql

2. Go to the installation directory and use/usr/localas an example to decompress the binary distribution version of .tar.gz.

Shell> gunzip </path/to/mysql-VERSION-OS.tar.gz | tar xvf-

Shell> ln-s full-path-to-mysql-VERSION-OS mysql

Or:

Shell> tar zxvf/path/to/mysql-VERSION-OS.tar.gz

3. In the mysql directory, you will find several files and subdirectories under the mysql directory. The most important for installation is the "bin" and "scripts" subdirectories.

· Bin

This directory contains the client program and server. You should add the full PATH of this directory to the path environment variable so that shell can find the MySQL program correctly. See Appendix F: environment variables.

· Scripts

This directory contains the mysql_install_db script, which is used to initialize the mysql database authorization table, where server access is allowed.

Note: If MySQL has not been installed, you must create a MySQL authorization table:
Shell> scripts/mysql_install_db -- user = mysql
4. Change the binary ownership of the program to root, and change the ownership of the data directory to the user who runs mysqld. If you are in the installation directory (/usr/local/mysql), the command should be:

Shell> chown-R root.

Shell> chown-R mysql data

Shell> chgrp-R mysql.
The first command changes all attributes of the file to the root user. The second command changes all the attributes of the data directory to the mysql user. The third command changes the group attribute to the mysql group.

5. Here, the server can start according to the MySQL documentation:

Shell> bin/mysqld_safe -- user = mysql &
However, in coreora Core7, the problem occurs. The following message is displayed, indicating that the server cannot be started.
-------------------------------------------------------------------------
Nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from/var/lib/mysql
STOPPING server from pid file/var/run/mysqld. pid
071030 02:28:14 mysqld ended
------------------------------------------------------------------------------
When the problem occurs, the log is not viewed at the beginning (you need to develop the habit of reading logs later !!)
---------------------------------------------------------------------
071030 14:23:56 mysqld started
Nohup: ignoring input
071030 14:23:56 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights
InnoDB: the directory.
InnoDB: File name./ibdata1
InnoDB: File operation call: 'create '.
InnoDB: Cannot continue operation.
071030 14:23:56 mysqld ended
---------------------------------------------------------------------------
Check/var/log/mysqld. log to determine the permission issue. Modify the file permissions under/var/lib/mysql:
Ibdata1 ib_logfile0 ib_logfile1
Shell> chmod 766/var/lib/mysql/ib *

Mysql client uses/tmp/mysql by default. sock starts socket, but/tmp/mysql. sock does not exist, mysql. sock in/var/lib/mysql. sock, or create a link pointing to the actual mysql. or modify the default settings of the mysql client.
1. Create a link to/var/lib/mysql. sock under/tmp.
Ln-s/var/lib/mysql. sock/tmp/mysql. sock
2. Better mysql client configuration (/etc/my. cnf)
Edit/etc/my. cnf and add the client configuration.
[Client]
Socket =/var/lib/mysql. sock

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.