In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The requested URL/usr/local/src/was not found on this server.
cd /usr/local/src/wget http://distfiles.macports.org/cmake/cmake-2.8.12.tar.gzwget http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.6/mysql-5.6.35.tar.gz
2, compile and install cmake compile and install mysql (the latest version requires cmake compile and install)
[root@server2 src]# tar -zxvfcmake-2.8.12.tar.gz[root@server2 src]# cd cmake-2.8.12[root@server2 cmake-2.8.12]# ./ bootstrap
Log of errors: /usr/local/src/cmake-2.8.12/Bootstrap.cmk/cmake_bootstrap.log
Solution:
Environment required to install LAMP
yum -y install make gcc* gcc-c++ zlib-devel libtool libtool-ltdllibtool-ltdl-devel bison ncurses-devel
After installing the required environment package, re-execute./ bootstrap
[root@server2 cmake-2.8.12]# ./ bootstrap[root@server2 cmake-2.8.12]# echo $? 0[root@server2 cmake-2.8.12]# gmake[root@server2 cmake-2.8.12]# echo $? 0[root@server2 cmake-2.8.12]# gmake install[root@server2 cmake-2.8.12]# echo $? 0
3. Create MySQL users
[root@server1 src]# groupadd mysql[root@server1 src]# useradd -g mysql -s/sbin/nologin -M mysql[root@server1 src]# id mysqluid=500(mysql) gid=500(mysql)groups=500(mysql)
4. Create a directory stored in the database and authorize it
[root@server1 mysql]# mkdir -p /data/mysql [root@server1 mysql]# chown -R mysql.mysql /data/mysql/[root@server1 mysql]# chown -R mysql.mysql /usr/local/mysql/. //Database installation path
5. Compile and install mysql
[root@server2 src]# tar -zxvfmysql-5.6.35.tar.gz[root@server2 src]# cd mysql-5.6.35[root@server2 mysql-5.6.35]# cmake \-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DMYSQL_UNIX_ADDR=/data/mysql/mysql_3306.sock \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DWITH_EXTRA_CHARSETS=utf8,gbk \-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \-DWITH_FEDERATED_STORAGE_ENGINE=1\ -DWITH_PARTITION_STORAGE_ENGINE=1 \-DWITH_ARCHIVE_STORAGE_EENGINE=1 \-DWITH_READLINE=1 \-DMYSQL_DATADIR=/data/mysql/ \-DMYSQL_TCP_PORT=3306
Parameter Description:
-DCMAKE_INSTALL_PREFIX #Specify the installation path
-DMYSQL_UNIX_ADDR #Database socket file path
-DDEFAULT_CHARSET #Default character set
-DDEFAULT_COLLATION #Default encoding
-DWITH_EXTRA_CHARSETS #extra encoding
-DWITH_PERFSCHEMA_STORAGE_ENGINE #Enable PERFSCHEMA engine support
-DWITH_FEDERATED_STORAGE_ENGINE #Enable FEDERATED engine support
-DWITH_PARTITION_STORAGE_ENGINE #Enable PARTITION engine support
-DWITH_ARCHIVE_STORAGE_EENGINE #Enable ARCHIVE engine support
-DWITH_READLINE #Use readline function
-DMYSQL_DATADIR #Database data repository directory
-DMYSQL_TCP_PORT #Database TCP/IP port
[root@server2 mysql-5.6.35]# echo $? 0[root@server2 mysql-5.6.35]# make[root@server2 mysql-5.6.35]# echo $? 0[root@server2 mysql-5.6.35]# make install[root@server2 mysql-5.6.35]# echo $? 0
bin directory contains client tools and mysqld
The data directory stores database data files and log files
The docs directory contains user manuals in info format
The include directory contains mysql header files
lib directory contains related lib libraries
The mysql-test directory contains some test script files for mysql
scripts directory holds mysql_install_db initialization files
The share directory stores various support files, including error messages, language encoding support, sql installation scripts, etc.
The Sqlbench directory holds benchmark scripts
The support-file directory stores mysql configuration file templates
The requested URL/etc/my.cnf was not found on this server.
[root@server2 mysql]# rm -f /etc/my.cnf[root@server2 mysql]# cd support-files/[root@server2 support-files]# lsbinary-configure magic mysqld_multi.server mysql-log-rotate mysql.server[root@server2 support-files]# cp /usr/local/mysql/support-files/ /etc/my.cnf
Edit the/etc/my.cnf configuration file and add the following line
user = mysql //user basedir = /usr/local/mysql //datadir = /data/mysql //database save directory port = 3306 The requested URL/data/mysql/mysql_3306.sock was not found on this server. log-error = /data/mysql/mysql_error.log The requested URL/data/mysql/mysql.pid was not found on this server. //PID #Memory usage limit performance_schema_max_table_instances=400 table_definition_cache=400 table_open_cache=256
7. Initialize the database
[root@server2 mysql]#/usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysql/[root@server2 mysql]# echo $? 0
Common problems with initializing the database: The system version is inconsistent with the database version, resulting in an error initializing the database.
The requested URL/etc/init.d/mysqld was not found on this server.
[root@server2 support-files]# cp /usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld[root@server2 support-files]# chmod +x/etc/init.d/mysqld
9. Join the startup mysql service
[root@server2 mysql]# chmod +x/etc/init.d/mysqld[root@server2 mysql]# chkconfig --addmysqld[root@server2 mysql]# chkconfig -level 35 mysqldon
10. Start MySQL service
[root@server2 mysql]# /etc/init.d/mysqldstartStarting MySQL. [ ]
The requested URL/data/mysql was not found on this server.
[root@server2 mysql]# ls /data/mysql/auto.cnf ib_logfile0 mysql mysql_error.log performance_schemaibdata1 ib_logfile1 mysql_3306.sock mysql.pid test [root@server2 mysql]# netstat -lnapt |grepmysqld tcp 0 0 :::3306 :::* LISTEN 3195/mysqld
12. Adding environmental variables
[root@server2 ~]# vim/etc/profile.d/mysql.sh
#!/ bin/bashexportPATH="$PATH:/usr/local/mysql/bin"
[root@server2 ~]# source/etc/profile.d/mysql.sh
13. The newly added mysql does not have the root password set. You can set the root password by using the following command:
#/usr/local/mysql/bin/mysqladmin -S /data/mysql/mysql_3306.sock-u root password 'new-password'
14. Log in to mysql
[root@server2 ~]# mysql
ERROR 2002 (HY000): Can'tconnect to local MySQL server through socket '/tmp/mysql.sock' (2)
Problem: mysql.sock not found in/tmp directory, there are three solutions:
1) Soft link/data/mysql/mysql_3306.sock to/tmp/mysql.sock
ln -s /data/mysql/mysql_3306.sock/tmp/mysql.sock
2) Modify/etc/my.cnf to add the following line
[client]
socket = /data/mysql/mysql_3306.sock
3) Execute the following command to specify the socket connection file, mysql -S /data/mysql/mysql_3306.sock
[root@server2 ~]# mysql -S/data/mysql/mysql_3306.sock
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.