In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Mirror Source:
http://mirrors.sohu.com/
1. Binary quick MySQL database installation command set
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
###################
2. Create users and directories
useradd mysql -s /sbin/nologin -M
chown -R mysql.mysql /application/mysql/data/
3. initialize 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
Install mysql 5.7.11 new version:
mysql 5.6 and above binary compilation has changed:
cd /usr/local/src wget 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 $?#======== This is the first time that I've ever seen a woman who's been in a relationship with someone else. 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 solution:
The compilation process will also have relevant prompts when executing this command:
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql-5.7.11 --datadir=/usr/local/mysql-5.7.11/data/mysqldata
Prompt timestamp expired.
Link address: http://blog.itpub.net/27099995/viewspace-1280489/
http://www.open-open.com/news/view/1b1ebea
In particular, according to the official documentation, starting with version 5.7.6, MySQL initializes using the mysqld --initialize command instead of the mysql_install_db command. However, the mysqld --initialize command given in the official documentation does not give the--basedir and--datadir parameters, because it uses the/etc/my.cnf configuration file by default. Some Linux distributions may generate this mysql configuration file by default during installation and save it in the/etc directory, while the basedir and datadir in the default configuration file are annotated and have no actual content, so mysqld actually does not know which directory the current basedir and datadir are. So here we specify our custom directory via command-line arguments. The mysql_ssl_rsa_setup command also specifies the datadir directory, because the key files required by the database are also stored with the data files and are located in the datadir directory.
Log in to MySQL service natively, since version 5.7.10, root null password is not allowed to log in. In fact, after executing mysqld --initialize, the system will generate an initialization password for root and display it on the screen standard output. Remember this! After logging in for the first time with this password, you can modify the password again. Assume that the initialization password generated by the system is xxxxxx. The command is as follows:
# bin/mysql --user=root --password=xxxxxx
This will allow you to log in to MySQL Server.
After logging in, the system requires that the password of the root account must be modified. MySQL commands are 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
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.