MySQL installation process and error messages

Source: Internet
Author: User

MySQL Installation steps:

#下载, unzip the source package and move to the specified directory:

wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-x86_64-icc-glibc23.tar.gz

Tar zxvf mysql-5.1.40-linux-x86_64-icc-glibc23.tar.gz

MV Mysql-5.1.40-linux-x86_64-icc-glibc23.tar.gz/usr/local/mysql

#新建数据库存储路径:

Mkdir-p/data/mysql

#创建mysql的管理用户:

Useradd-s/sbin/nologin MySQL

Chown-r/usr/local/mysql

#拷贝mysql实例和到开机启动服务

Cp/usr/local/mysql/data/support-files/my-medium.cnf/etc/my.cnf

Cp/usr/local/mysql/data/support-files/mysql.server/etc/init.d/mysqld

#修改上述两个配置文件

Vi/etc/my.cnf

Log-bin=mysql-bin/server-id =1/binlog_format=mixed Three comments out, behind MySQL master and slave time used to

     #socket, using socket communication, turn off

     add a row after skip-network close Port 3306, the external network does not detect

  vi/etc/init.d/mysqld

    basedir=/usr/local/mysql

    datadir=/usr/local/myslq/data/mysql

  #将mysqld添加到chkconfig服务启动项

    chkconfig--add mysqld

    chkconfig mysqld on (chkconfig see which boot services have been added; chkconfig--del xx delete)

  #启动mysqld服务

    service mysqld start or/etc/init.c/mysqld start

  #检验是否成功:

    ps aux |grep mysql or netstat-npl |grep 3306

Error:

#./script/mysql_install_db--user=mysql--datadir=/data/mysql error when initializing MySQL

FATAL error:could not find./bin/my_print_defaults
Workaround: The absolute path of the DataDir is not specified first, and no basedir path is specified

./script/mysql_install_db--user=mysql--datadir=/usr/local/data/mysql--basedir=/usr/local/mysql

echo $? See if the output is correct: 0 correct, 1 error

#./script/mysql_install_db--user=mysql--datadir=/usr/local/data/mysql--basedir=/usr/local/mysql initialize times wrong:

Error:1 Can ' t create/write to file '/usr/local/mysql/data/mysql/mysql/db. MYI ' (errcode:13)

Workaround: Or/usr/local/mysql permissions issue

Chown-r Mysql:mysql/usr/local/mysql

echo $? 0 and two OK

#/etc/init.d/mysqld Start mysqld Service is started

Error: Starting MySQL. error! Manager of Pid-file quit without updating file.

Workaround: Reinitialize./script/mysql_install_db--user=mysql

Results: SUCCESS

MySQL installation process and error messages

Related Article

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.