CentOS安裝使用二進位制方式mysql5.6筆記
CentOS安裝使用二進位制方式mysql5.6筆記
1、上傳安裝包--使用root使用者2、解壓安裝包--使用root使用者
cd /usr/local/
tar xzvf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.23-linux-glibc2.5-x86_64 mysql
3、建立mysql管理使用者組與使用者--使用root使用者
groupadd -g 101 dba
useradd -u 514 -g dba -G root -d /usr/local/mysql mysqladmin
驗證:id mysqladmin
4、修改mysqladmin使用者密碼--使用root使用者
passwd mysqladmin
提示:
Changing password for user mysqladmin.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
5、copy 環境變數配置檔案至mysqladmin使用者的home目錄中,為了以下步驟配置個人環境變數--使用root使用者
cp /etc/skel/.* /usr/local/mysql
提示:
cp: omitting directory `/etc/skel/.'
cp: omitting directory `/etc/skel/..'
cp: omitting directory `/etc/skel/.mozilla'
6、修改/etc/my.cnf檔案,並刪除原檔案內容,將以下內容填寫到my.cnf檔案中--使用root使用者
vi /etc/my.cnf
[client]
port = 3306
socket = /usr/local/mysql/data/mysql.sock
[mysqld]
port = 3306
socket = /usr/local/mysql/data/mysql.sock
skip-external-locking
key_buffer_size = 256M
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
query_cache_size= 32M
max_allowed_packet = 16M
myisam_sort_buffer_size=128M
tmp_table_size=32M
table_open_cache = 512
thread_cache_size = 8
wait_timeout = 86400
interactive_timeout = 86400
max_connections = 600
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 32
#isolation level and default engine
default-storage-engine = INNODB
transaction-isolation = READ-COMMITTED
server-id = 1
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
pid-file = /usr/local/mysql/data/hostname.pid
#open performance schema
log-warnings
sysdate-is-now
binlog_format = MIXED
log_bin_trust_function_creators=1
log-error = /usr/local/mysql/data/hostname.err
log-bin=/usr/local/mysql/arch/mysql-bin
#other logs
#general_log =1
#general_log_file = /usr/local/mysql/data/general_log.err
#slow_query_log=1
#slow_query_log_file=/usr/local/mysql/data/slow_log.err
#for replication slave
#log-slave-updates
#sync_binlog = 1
#for innodb options
innodb_data_home_dir = /usr/local/mysql/data/
innodb_data_file_path = ibdata1:500M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/arch
innodb_log_files_in_group = 2
innodb_log_file_size = 200M
innodb_buffer_pool_size = 2048M
innodb_additional_mem_pool_size = 50M
innodb_log_buffer_size = 16M
innodb_lock_wait_timeout = 100
#innodb_thread_concurrency = 0
innodb_flush_log_at_trx_commit = 1
innodb_locks_unsafe_for_binlog=1
#innodb io features: add for mysql5.5.8
performance_schema
innodb_read_io_threads=4
innodb-write-io-threads=4
innodb-io-capacity=200
#purge threads change default(0) to 1 for purge
innodb_purge_threads=1
innodb_use_native_aio=on
#case-sensitive file names and separate tablespace
innodb_file_per_table = 1
lower_case_table_names=1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[mysqlhotcopy]
interactive-timeout
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
7、修改/etc/my.cnf檔案使用者組與使用者、許可權--使用root使用者
cd /usr/local
chown mysqladmin:dba /etc/my.cnf
chmod 640 /etc/my.cnf
驗證:
ll my.cnf
-rw-r----- 1 mysqladmin dba 2201 Dec 19 11:19:40 my.cnf
8、修改mysql安裝檔案使用者組與使用者、許可權--使用root使用者
chown -R mysqladmin:dba /usr/local/mysql
chmod -R 755 /usr/local/mysql
su - mysqladmin
pwd顯示:/usr/local/mysql
9、建立arch目錄--使用mysqladmin使用者
cd /usr/local/mysql
mkdir arch
10、檢查gcc、libaio、perl以及perl-devel包是否安裝
rpm -qa|grep gcc libaio perl perl-devel
如未安裝,則使用yum方式安裝:yum -y install libaio、yum -y install gcc、yum -y install perl
11、二進位制安裝
scripts/mysql_install_db --user=mysqladmin --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
提示:
Installing MySQL system tables...2017-12-19 11:39:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
OK
Filling help tables...2017-12-19 11:39:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h sht-sgmhadoopnn-01 password 'new-password'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems at
The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at
New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server
12、啟動mysql--使用mysqladmin使用者
su - mysqladmin
cd /usr/local/mysql
rm -rf my.cnf
bin/mysqld_safe &
驗證是否啟動:ps -ef|grep mysqld、netstat -tulnp | grep mysql
13、登入mysql,並修改mysql中的root密碼內容--使用mysqladmin使用者
mysql
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
注:如mysql資料庫名稱,則退出(exit)使用:mysql -uroot -p,提示輸入密碼時直接回車
mysql> use mysql
mysql> update user set password=password('123456') where user='root';
mysql> select host,user,password from user;
mysql> delete from user where user='';
mysql> select host,user,password from user;
mysql> flush privileges;
若澤大資料交流群:671914634
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31511218/viewspace-2148860/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos7二進位制方式安裝rabbitmqCentOSMQ
- ubuntu mysql5.6二進位制安裝UbuntuMySql
- CentOS6.6安裝二進位制壓縮包mysql5.6CentOSMySql
- centos 7 二進位制安裝mysql 5.7.25CentOSMySql
- 二進位制方式安裝mysql 5.6.15MySql
- 二進位制方式安裝 k8sK8S
- CentOS7 安裝 MySQL8.0(二進位制)CentOSMySql
- HWS二進位制筆記筆記
- 使用二進位制包來安裝MySQLMySql
- centos7搭建lnmp安裝二進位制mysql【三】CentOSLNMPMySql
- MySQL 安裝指南 二進位制安裝MySql
- Windows11二進位制方式安裝MySQL5.7.44WindowsMySql
- PostgreSQL二進位制安裝流程SQL
- Mysql二進位制包安裝MySql
- CentOS6.5二進位制檔案安裝MySQL5.6.39CentOSMySql
- centos7環境下二進位制編譯安裝ffmpegCentOS編譯
- MySQL linux二進位制安裝MySqlLinux
- 二進位制檔案安裝安裝etcd
- mysql安裝-----二進位制包安裝及解除安裝MySql
- CentOS 6 下RPM方式安裝MySQL5.6CentOSMySql
- Centos64位6.3 下安裝 Mysql5.6CentOSMySql
- Percona MySQL 5.7 Linux通用二進位制包安裝(CentOS 6.5)MySqlLinuxCentOS
- Percona MySQL 5.5 Linux通用二進位制包安裝(CentOS 6.9)MySqlLinuxCentOS
- Mysql for Linux安裝配置之——二進位制安裝MySqlLinux
- PostgreSQL 10.23 二進位制安裝SQL
- MySQL5.7 windows二進位制安裝MySqlWindows
- 【Linux合集】二進位制安裝mysqlLinuxMySql
- mysql二進位制包安裝與配置實戰記錄MySql
- KITTI-二進位制點雲資料集使用筆記筆記
- 03二進位制包安裝與介紹
- RHEL 7.2 安裝二進位制MySQL 5.7.18MySql
- Linux安裝二進位制PHP7.2LinuxPHP
- yum安裝nginx-php-mysql二進位制NginxPHPMySql
- MySQL5.7 linux二進位制安裝MySqlLinux
- (OEL 6.3) Mysql6.5二進位制安裝MySql
- 二進位制安裝 Docker 以及 Docker ComposeDocker
- Ubuntu 24.04 二進位制安裝 MySQL 8.0.20UbuntuMySql
- Docker Centos安裝Mysql5.6DockerCentOSMySql