mkdir /data
chown -R mysql:mysql /data
cd
mv mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz /data/mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz
mkdir -p /software/mysql
chown -R mysql:mysql /software
cd /software/mysql
tar zxvf /data/mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz
cd /usr/local/
unlink mysql
ln -s /software/mysql-5.7.30-linux-glibc2.12-x86_64 mysql
chown -R mysql:mysql mysql
mkdir /data/mysql
mkdir /data/mysql/mysql_3306
cd /data/mysql/mysql_3306/
mkdir data
mkdir logs
mkdir tmp
chown -R mysql:mysql /data/mysql/mysql_3306
vi /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql3306.sock
[mysql]
#prompt="(u:HOSTNAME:)[d]> "
prompt="u@h R:m:s [d]> "
no-auto-rehash
[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql3306.sock
basedir = /usr/local/mysql
datadir = /data/mysql/mysql_3306/data
character-set-server = utf8
back_log = 103
slow_query_log = 1
slow_query_log_file = /data/mysql/mysql_3306/data/slow.log
log-error = /data/mysql/mysql_3306/data/error.log
long_query_time = 0.1
server-id = 813306
log-bin = /data/mysql/mysql_3306/logs/log-bin
sync_binlog = 1
binlog_cache_size = 4M
binlog_format = row
relay_log_recovery = 1
transaction_isolation = REPEATABLE-READ
#innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 5734M
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_data_file_path = ibdata1:1024M;ibdata2:1024M;ibdata3:1024M:autoextend
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 16M
innodb_log_file_size = 2G
innodb_log_files_in_group = 2
innodb_rollback_on_timeout = 1
innodb_print_all_deadlocks = 1
innodb_file_per_table = 1
innodb_locks_unsafe_for_binlog = 0
cd /usr/local/mysql
./bin/mysqld --initialize-insecure
cd /usr/local/mysql
[root@master01 mysql]# pwd
/usr/local/mysql
[root@master01 mysql]#
[root@master01 mysql]# <+++++++++++++無任何回顯
[root@Mysql01 mysql]# ./bin/mysqld --initialize-insecure
#–initialize-insecure,不需要密碼即可進入
[root@Mysql01 mysql]# ./bin/mysqld --initialize
./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
[root@Mysql01 mysql]#
[root@Mysql01 mysql]#
[root@Mysql01 mysql]# yum -y install libaio.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 973 kB 00:00:00
(2/2): epel/x86_64/primary_db | 6.7 MB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================================
Installing:
libaio x86_64 0.3.109-13.el7 base 24 k
Transaction Summary
=================================================================================================================================================================================================================================
Install 1 Package
Total download size: 24 k
Installed size: 38 k
Downloading packages:
libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libaio-0.3.109-13.el7.x86_64 1/1
Verifying : libaio-0.3.109-13.el7.x86_64 1/1
Installed:
libaio.x86_64 0:0.3.109-13.el7
Complete!
[root@Mysql01 mysql]#
[root@Mysql01 mysql]#
[root@Mysql01 mysql]#
cd /usr/local/mysql
cp support-files/mysql.server /etc/init.d/mysql
echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile
source /etc/profile
====
[root@master01 ~]# chkconfig --list
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use systemctl list-unit-files.
To see services enabled on particular target use
systemctl list-dependencies [target].
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@master01 ~]# chkconfig --add mysql.server
error reading information on service mysql.server: No such file or directory
[root@master01 ~]#
[root@master01 ~]#
[root@master01 ~]# chkconfig --add mysql
[root@master01 ~]# chkconfig --list
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use systemctl list-unit-files.
To see services enabled on particular target use
systemctl list-dependencies [target].
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@master01 ~]#
=====
service mysql start |stop|restart
cat /data/mysql/mysql_3306/data/error.log |grep "password"
2017-11-01T07:31:33.932297Z 1 [Note] A temporary password is generated for root@localhost: XX41vxuK;=!q
mysql -S /tmp/mysql3306.sock -uroot -p
alter user root@localhost identified by abcd1234;
flush privileges;
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/129340.html
摘要:在阿里云平臺上,可通過自帶的鏡像市場實現一鍵部署系統的數據庫,完美解決耗時長部署易出錯的缺陷。操作步驟登錄云服務器管理控制臺。單擊左側導航中的云服務器創建實例。在ECS上部署數據庫 數據庫是依照某種數據模型組織起來并存放二級存儲器中的數據集合。這種數據集合具有如下特點:盡可能不重復,以最優方式為某個特定組織的多種應用服務,其數據結構獨立于使用它的應用程序,對數據的增、刪、改和檢索由統一軟件進...
摘要:配置這個啟動其他方式安裝七牛云由于網站的靜態存儲要用七牛云,在運行程序前要安裝否則報錯沒有的方法。七牛云安裝前注意安裝的版本,我被坑過一次,寫程序時是版本,部署時都了,接口全都不一樣。還有推薦下這篇來自的部署實例 以下所有代碼中的操作都需要在命令行運行 安裝mysql apt-get update apt-get install mysql-server mysql-client 根據...
摘要:一的函數,在代碼塊中,可以自定義很多功能來實現自定義的開發,具體可以參考在線的文檔二需要用腳本配置環境變量,安裝部署,安裝部署。 windows一鍵部署java項目 因為公司需求,要在windows的環境上做一鍵部署啟動java項目,同時還要支持從安裝界面動態修改配置文件的IP地址。就像安裝軟件一樣將jdk,tomcat,mysql,influxdb,nginx安裝并配置到系統上,順便...
閱讀 1346·2023-01-11 13:20
閱讀 1684·2023-01-11 13:20
閱讀 1132·2023-01-11 13:20
閱讀 1858·2023-01-11 13:20
閱讀 4099·2023-01-11 13:20
閱讀 2704·2023-01-11 13:20
閱讀 1385·2023-01-11 13:20
閱讀 3594·2023-01-11 13:20