Summary of MySql5.7.11 compiling and installing and modifying the root password, mysql5.7.11root

Source: Internet
Author: User

Summary of MySql5.7.11 compiling and installing and modifying the root password, mysql5.7.11root

Recommended reading:

Mysql5.7 how to forget the root password and mysql5.7 how to change the root password

How to install and uninstall Mysql5.7.11 on Mac

The system is cenos6.7 64-bit. By default, mysql5.7.11 is downloaded to/usr/local/src. The installation directory is in the/app/local/mysql directory, mysql data DIRECTORY/app/local/data. Mysql is compiled and installed in cmake mode after mysql 5.1. Therefore, you must compile and install the cmake tool first, or install cmake in yum mode. Compiling and installation from mysql5.7 requires support from the boost library, so you must also download the boost Library

#wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.11.tar.gz#wget https://cmake.org/files/v3.1/cmake-3.1.3.tar.gz#wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz

If you do not have a mysql user, create a mysql user.

#groupadd mysql#useradd -g mysql mysql -s /bin/false

Create a directory

#mkdir -p /app/local/{mysql,data}#mkdir /usr/local/boost

Compile and install cmake

#tar zxvf cmake-3.1.3.tar.gz#cd cmake-3.1.3#./configure#make && make install#cd ../

Decompress the boost Library to the/usr/local/boost directory.

#tar zxvf boost_1_59_0.tar.gz#cd boost_1_59_0/#mv ./* /usr/local/boost/#cd ../

Compile and install mysql5.7.11

# Tar zxvf mysql-5.7.11.tar.gz # cd mysql-5.7.11 # cmake-DCMAKE_INSTALL_PREFIX =/app/local/mysql/-keys =/app/local/data-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-keys = 3306 -DMYSQL_USER = mysql-runtime = 1-DWITH_INNOBASE_STORAGE_ENGINE = 1-runtime = 1-runtime = 1-DWITH_MEMORY_STORAGE_ENGINE = 1-DDOWNLOAD_BOOST = 1-DWITH_BOOST =/usr/local/boost # make & & make install # cd .. /# chown-R mysql: mysql/app/local/data/# chown-R mysql: mysql/app/local/mysql/# cd/app/local/mysql/bin #. /mysqld -- initialize -- user = mysql -- basedir =/app/local/mysql/-- datadir =/app/local/data/# initialize mysql and generate a random password # mv/etc /my. cnf/etc/my. cnfbak # back up the generated my. cnf # cp .. /support-files/my-default.cnf/etc/my. cnf # cp .. /support-files/mysql. server/etc/init. d/mysqld # chmod 755/etc/init. d/mysqld # chkconfig mysqld on # service mysqld start # mysql-uroot-p

Enter password:

Log On with the generated Random Password

If not, configure password in my. cnf.

Reset the root password after Logon

mysql> SET PASSWORD FOR 'root'@localhost = PASSWORD('123456');Query OK, 0 rows affected, 1 warning (0.00 sec)


You can.

As for the compilation and installation of MySql5.7.11 and the method for modifying the root password described in the editor, I hope it will be helpful to you!

Articles you may be interested in:
  • How does one forget the root password for mysql in windows?
  • MySQL-four methods for modifying the root password (take windows as an example)
  • How to change the default mysql null password (root password) in xampp
  • One-Click Reset mysql root Password implementation script
  • How to restore the root user deleted by mistake in mysql
  • Mysql Access denied for user 'root' @ 'localhost' (using password: YES) Solution
  • How to change the password of the root account in MySQL
  • Mysql5.7 how to forget the root password and mysql5.7 how to change the root password
  • How to install and uninstall Mysql5.7.11 on Mac

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.