1. mysql安装
# Preconfiguration setup shell > groupadd mysql shell > useradd -r -g mysql -s /bin/false mysql # Beginning of source-build specific instructions shell > tar zxvf mysql-5.7.9.tar.gz shell > cd mysql-5.7.9 shell > cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.7.9 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=ON -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_READLINE=ON -DWITH_BOOST=/usr/local/src/boost-1.59.0 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql/data -DMYSQL_USER=mysql -DMYSQL_UNIX_ADDR=/data/mysql/data/mysql.sock shell > make shell > make install shell > ls -n /usr/local/mysql-5.7.9 /usr/local/mysql shell > cd /usr/local/mysql shell > chown -R mysql . shell > chgrp -R mysql . shell> bin/mysql_install_db --user=mysql # Before MySQL 5.7.6 shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and up shell> bin/mysql_ssl_rsa_setup # MySQL 5.7.6 and up shell> chown -R root . shell> chown -R mysql /data/mysql/data shell> bin/mysqld_safe --user=mysql & shell> cp support-files/mysql.server /etc/init.d/mysql.server
时间: 2024-10-17 21:12:12