Binary mode quick install MySQL database command collection

Source: Internet
Author: User

Image source:

http://mirrors.sohu.com/

1. Binary mode quick install MySQL database command collection

1. Install MySQL
Cd/usr/local/srcwget Http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.48-linux2.6-x86_64.tar.gzls Mysql-5.5.32-linux2.6-x86_64.tar.gz
Tar XF mysql-5.5.32-linux2.6-x86_64.tar.gz
MV mysql-5.5.32-linux2.6-x86_64/application/mysql-5.5.32
Ln-s/application/mysql-5.5.32/application/mysql
######### #相当于编译步骤的make Install completed #############
2. Create Users and directories
Useradd mysql-s/sbin/nologin-m
Chown-r mysql.mysql/application/mysql/data/
3. Initializing the database
Cd/application/mysql
./scripts/mysql_install_db--user=mysql--basedir=/application/mysql--datadir=/application/mysql/data/
\CP support-files/my-small.cnf/etc/my.cnf
CP Support-files/mysql.server/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld
Sed-i ' S#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe/etc/init.d/mysqld
/etc/init.d/mysqld start
Netstat-lntup|grep MySQL
Cp-a/application/mysql/bin/*/usr/local/sbin/
Mysqladmin Password oldboy123
Mysql-uroot-poldboy123

To install a new version of mysql5.7.11:

mysql5.6 version binary compilation has changed:

cd /usr/local/srcwget tar zxf mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz useradd  -r -m -s /sbin/nologin mysql    mv  mysql-5.7.11-linux-glibc2.5-x86_64 mysql-5.7.11    chown -r mysql   /usr/local/mysql-5.7.11    chgrp -r mysql /usr/local/mysql-5.7.11     cd mysql-5.7.11    echo $?#======== These two sentences are mysql5.7 after the updated initialization mode =========================    bin/mysqld --initialize --user=mysql --basedir =/usr/local/mysql-5.7.11 --datadir=/usr/local/mysql-5.7.11/data/mysqldata    bin/ mysql_ssl_rsa_setup --datadir=/usr/local/mysql-5.7.11/data/mysqldata#==========end======================= ===============    cp support-files/my-default.cnf my.cnf     ln -s /usr/local/mysql-5.7.11 /usr/local/mysql    mv /etc/my.cnf /etc/my.cnf.bak    cp  My.cnf /etc/my.cnf    cp ./support-files/mysql.server /etc/init.d/mysqld     chmod +x /etc/init.d/mysqld    /etc/init.d/mysqld  start    netstat -lntup|grep mysql    cp -a /usr/ Local/mysql-5.7.11/bin/* /usr/local/sbin/    mysql -uroot -proot


Installation Error and resolution:


650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "style=" Background:url ("/e/u261/ Lang/zh-cn/images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>


There are also hints when the compilation process executes the command:

Bin/mysqld--initialize--user=mysql--basedir=/usr/local/mysql-5.7.11--datadir=/usr/local/mysql-5.7.11/data/ Mysqldata


Indicates that the timestamp has expired.

Connection Address: http://blog.itpub.net/27099995/viewspace-1280489/

Http://www.open-open.com/news/view/1b1ebea

  

log in to the MySQL service on this machine, starting from version 5.7.10 does not allow the root empty password to log in. In fact, after executing mysqld--initialize, the system will generate an initial password for root and display it on the standard output of the screen, remember! after the first login with this password, before you can change the password, this assumes that the system generated the initial password is xxxxxx, the command is as follows:

# Bin/mysql--user=root--password=xxxxxx

This will allow you to log in to the MySQL server.


After logging in, the system requires you to modify the root account password, the MySQL command is as follows:

Mysql> set Password=password (' 1234 ');

This will change the root account to 1234.


Source: http://www.linuxidc.com/Linux/2016-03/129187.htm



This article is from the "Heart of the Past" blog, please be sure to keep this source http://jwlin.blog.51cto.com/7560932/1775679

Binary mode quick install MySQL database command collection

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.