| 正式安装mysql |
| [root@oracle scripts] |
| |
| [root@oracle bin] |
| Usage: ./mysqld_safe [OPTIONS] |
| --no-defaults Don't read the system defaults file |
| --defaults-file=FILE Use the specified defaults file |
| --defaults-extra-file=FILE Also use defaults from the specified file |
| --ledir=DIRECTORY Look for mysqld in the specified directory |
| --open-files-limit=LIMIT Limit the number of open files |
| --core-file-size=LIMIT Limit core files to the specified size |
| --timezone=TZ Set the system timezone |
| --malloc-lib=LIB Preload shared library LIB if available |
| --mysqld=FILE Use the specified file as mysqld |
| --mysqld-version=VERSION Use "mysqld-VERSION" as mysqld |
| --nice=NICE Set the scheduling priority of mysqld |
| --plugin-dir=DIR Plugins are under DIR or DIR/VERSION, if |
| VERSION is given |
| --skip-kill-mysqld Don't try to kill stray mysqld processes |
| --syslog Log messages to syslog with 'logger' |
| --skip-syslog Log messages to error log (default) |
| --syslog-tag=TAG Pass -t "mysqld-TAG" to 'logger' |
| |
| All other options are passed to the mysqld program. |
| [root@oracle bin] |
| Tips :mysqld_safe后面紧跟--defaults-file=/etc/my.cnf 这个参数 |
| 安装成功 |
| [root@oracle bin] |
| Welcome to the MySQL monitor. Commands end with ; or \g. |
| Your MySQL connection id is 1 |
| Server version: 5.6.16-log MySQL Community Server (GPL) |
| |
| Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| |
| Oracle is a registered trademark of Oracle Corporation and/or its |
| affiliates. Other names may be trademarks of their respective |
| owners. |
| |
| Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
| |
| mysql> show databases; |
| +--------------------+ |
| | Database | |
| +--------------------+ |
| | information_schema | |
| | mysql | |
| | performance_schema | |
| | test | |
| +--------------------+ |
| 4 rows in set (0.02 sec) |
| |
| mysql> |
| ********mysql的用户密码信息,只需要保留‘localhost | root’ |
| ********root只能用于本地用户使用(DBA自己使用的) |
| |
| mysql> select host,user,password from user; |
| +-----------+------+----------+ |
| | host | user | password | |
| +-----------+------+----------+ |
| | localhost | root | | |
| | oracle | root | | |
| | 127.0.0.1 | root | | |
| | ::1 | root | | |
| | localhost | | | |
| | oracle | | | |
| +-----------+------+----------+ |
| 6 rows in set (0.00 sec) |
| |
| mysql> delete from user where host!='localhost' or user!='root'; |
| Query OK, 5 rows affected (0.00 sec) |
| |
| mysql> select host,user,password from user; |
| +-----------+------+----------+ |
| | host | user | password | |
| +-----------+------+----------+ |
| | localhost | root | | |
| +-----------+------+----------+ |
| 1 row in set (0.00 sec) |
| |
| mysql> update user set password=password('root123'); |
| Query OK, 1 row affected (0.02 sec) |
| Rows matched: 1 Changed: 1 Warnings: 0 |
| |
| mysql> select host,user,password from user; |
| +-----------+------+-------------------------------------------+ |
| | host | user | password | |
| +-----------+------+-------------------------------------------+ |
| | localhost | root | *FAAFFE644E901CFAFAEC7562415E5FAEC243B8B2 | |
| +-----------+------+-------------------------------------------+ |
| 1 row in set (0.00 sec) |
| |
| mysql> quit |
| Bye |
| [root@oracle bin] |
| Welcome to the MySQL monitor. Commands end with ; or \g. |
| Your MySQL connection id is 2 |
| Server version: 5.6.16-log MySQL Community Server (GPL) |
| |
| Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| |
| Oracle is a registered trademark of Oracle Corporation and/or its |
| affiliates. Other names may be trademarks of their respective |
| owners. |
| |
| Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
| |
| mysql> flush privileges; |
| Query OK, 0 rows affected (0.01 sec) |
| |
| mysql> quit |
| Bye |
| [root@oracle bin] |
| ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) |
| [root@oracle bin] |
| Enter password: |
| Welcome to the MySQL monitor. Commands end with ; or \g. |
| Your MySQL connection id is 4 |
| Server version: 5.6.16-log MySQL Community Server (GPL) |
| |
| Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| |
| Oracle is a registered trademark of Oracle Corporation and/or its |
| affiliates. Other names may be trademarks of their respective |
| owners. |
| |
| Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
| |
| mysql> |
| |
| 关闭mysql数据库 |
| [root@oracle bin] |
| 这是正常关闭数据库的命令,这样不会损坏数据文件 |
| |
| ***如果忘记密码 |
| [root@oracle bin] |
| [1] 4484 |
| [root@oracle bin] |
| 170328 17:33:59 mysqld_safe Starting mysqld daemon with databases from /data/mysql |
| |
| [root@oracle bin] |
| [root@oracle bin] |
| [root@oracle bin] |
| Welcome to the MySQL monitor. Commands end with ; or \g. |
| Your MySQL connection id is 1 |
| Server version: 5.6.16-log MySQL Community Server (GPL) |
| |
| Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| |
| Oracle is a registered trademark of Oracle Corporation and/or its |
| affiliates. Other names may be trademarks of their respective |
| owners. |
| |
| Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
| |
| mysql> |
| 创建单机多实例数据库 |
| 一般用多机多实例 |
| [root@localhost mysql_3308] |
| [client] |
| |
| |
| |
| |
| [mysql] |
| |
| |
| [mysqld3306] |
| port = 3306 |
| socket = /tmp/mysql.sock |
| basedir = /usr/local/mysql |
| datadir = /data/mysql_3306 |
| socket = /tmp/mysql_3306.sock |
| slow_query_log_file = /data/mysql_3306/slow.log |
| log-error = /data/mysql_3306/error.log |
| log-bin = /data/mysql_3306/mysql-bin |
| sync_binlog = 1 |
| binlog_format=row |
| transaction_isolation = REPEATABLE-READ |
| innodb_buffer_pool_size = 100m |
| |
| [mysqld3308] |
| port = 3308 |
| socket = /tmp/mysql.sock |
| basedir = /usr/local/mysql |
| datadir = /data/mysql_3308 |
| socket = /tmp/mysql_3308.sock |
| slow_query_log = 1 |
| slow_query_log_file = /data/mysql_3308/slow.log |
| log-error = /data/mysql_3308/error.log |
| long_query_time = 0.05 |
| log-bin = /data/mysql_3308/mysql-bin |
| sync_binlog = 1 |
| binlog_cache_size = 4M |
| default-storage-engine=InnoDB |
| binlog_format=row |
| transaction_isolation = REPEATABLE-READ |
| innodb_buffer_pool_size = 100m |
| |
| [mysqld_multi] |
| mysqld=/usr/local/mysql/bin/mysqld_safe |
| mysqladmin=/usr/local/mysql/bin/mysqladmin |
| |
| [root@localhost data] |
| total 12 |
| drwxr-xr-x 5 mysql mysql 4096 Apr 13 14:33 mysql |
| drwxr-xr-x 5 mysql mysql 4096 Apr 13 15:14 mysql_3306 |
| drwxr-xr-x 5 mysql mysql 4096 Apr 13 15:14 mysql_3308 |
| |
| [root@localhost mysql] |
| Installing MySQL system tables...2017-04-13 15:44:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Using atomics to ref count buffer pool pages |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: The InnoDB memory heap is disabled |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Compressed tables use zlib 1.2.3 |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Using Linux native AIO |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Using CPU crc32 instructions |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Initializing buffer pool, size = 128.0M |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Completed initialization of buffer pool |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Database physically writes the file full: wait... |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB |
| 2017-04-13 15:44:06 6041 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 |
| 2017-04-13 15:44:07 6041 [Warning] InnoDB: New log files created, LSN=45781 |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: Doublewrite buffer not found: creating new |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: Doublewrite buffer created |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: 128 rollback segment(s) are active. |
| 2017-04-13 15:44:07 6041 [Warning] InnoDB: Creating foreign key constraint system tables. |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: Foreign key constraint system tables created |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: Creating tablespace and datafile system tables. |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: Tablespace and datafile system tables created. |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: Waiting for purge to start |
| 2017-04-13 15:44:07 6041 [Note] InnoDB: 5.6.16 started; log sequence number 0 |
| 2017-04-13 15:44:08 6041 [Note] Binlog end |
| 2017-04-13 15:44:08 6041 [Note] InnoDB: FTS optimize thread exiting. |
| 2017-04-13 15:44:08 6041 [Note] InnoDB: Starting shutdown... |
| 2017-04-13 15:44:09 6041 [Note] InnoDB: Shutdown completed; log sequence number 1625977 |
| OK |
| |
| Filling help tables...2017-04-13 15:44:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Using atomics to ref count buffer pool pages |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: The InnoDB memory heap is disabled |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Compressed tables use zlib 1.2.3 |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Using Linux native AIO |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Using CPU crc32 instructions |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Initializing buffer pool, size = 128.0M |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Completed initialization of buffer pool |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Highest supported file format is Barracuda. |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: 128 rollback segment(s) are active. |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Waiting for purge to start |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: 5.6.16 started; log sequence number 1625977 |
| 2017-04-13 15:44:09 6064 [Note] Binlog end |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: FTS optimize thread exiting. |
| 2017-04-13 15:44:09 6064 [Note] InnoDB: Starting shutdown... |
| 2017-04-13 15:44:11 6064 [Note] InnoDB: Shutdown completed; log sequence number 1625987 |
| 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: |
| |
| /usr/local/mysql//bin/mysqladmin -u root password 'new-password' |
| /usr/local/mysql//bin/mysqladmin -u root -h localhost.localdomain password 'new-password' |
| |
| Alternatively you can run: |
| |
| /usr/local/mysql//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 . ; /usr/local/mysql//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 http://bugs.mysql.com/ |
| |
| The latest information about MySQL is available on the web at |
| |
| http://www.mysql.com |
| |
| Support MySQL by buying support/licenses at http://shop.mysql.com |
| |
| WARNING: Found existing config file /usr/local/mysql//my.cnf on the system. |
| Because this file might be in use, it was not replaced, |
| but was used in bootstrap (unless you used --defaults-file) |
| and when you later start the server. |
| The new default config file was created as /usr/local/mysql//my-new.cnf, |
| please compare it with your file and take the changes you need. |
| |
| 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 |
| |
| |
| [root@localhost mysql] |
| Installing MySQL system tables...2017-04-13 15:55:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Using atomics to ref count buffer pool pages |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: The InnoDB memory heap is disabled |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Compressed tables use zlib 1.2.3 |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Using Linux native AIO |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Using CPU crc32 instructions |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Initializing buffer pool, size = 128.0M |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Completed initialization of buffer pool |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB |
| 2017-04-13 15:55:44 34767 [Note] InnoDB: Database physically writes the file full: wait... |
| 2017-04-13 15:55:45 34767 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB |
| 2017-04-13 15:55:46 34767 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 |
| 2017-04-13 15:55:47 34767 [Warning] InnoDB: New log files created, LSN=45781 |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: Doublewrite buffer not found: creating new |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: Doublewrite buffer created |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: 128 rollback segment(s) are active. |
| 2017-04-13 15:55:47 34767 [Warning] InnoDB: Creating foreign key constraint system tables. |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: Foreign key constraint system tables created |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: Creating tablespace and datafile system tables. |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: Tablespace and datafile system tables created. |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: Waiting for purge to start |
| 2017-04-13 15:55:47 34767 [Note] InnoDB: 5.6.16 started; log sequence number 0 |
| 2017-04-13 15:55:48 34767 [Note] Binlog end |
| 2017-04-13 15:55:48 34767 [Note] InnoDB: FTS optimize thread exiting. |
| 2017-04-13 15:55:48 34767 [Note] InnoDB: Starting shutdown... |
| 2017-04-13 15:55:49 34767 [Note] InnoDB: Shutdown completed; log sequence number 1625977 |
| OK |
| |
| Filling help tables...2017-04-13 15:55:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Using atomics to ref count buffer pool pages |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: The InnoDB memory heap is disabled |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Compressed tables use zlib 1.2.3 |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Using Linux native AIO |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Using CPU crc32 instructions |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Initializing buffer pool, size = 128.0M |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Completed initialization of buffer pool |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Highest supported file format is Barracuda. |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: 128 rollback segment(s) are active. |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Waiting for purge to start |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: 5.6.16 started; log sequence number 1625977 |
| 2017-04-13 15:55:49 34790 [Note] Binlog end |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: FTS optimize thread exiting. |
| 2017-04-13 15:55:49 34790 [Note] InnoDB: Starting shutdown... |
| 2017-04-13 15:55:51 34790 [Note] InnoDB: Shutdown completed; log sequence number 1625987 |
| 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: |
| |
| /usr/local/mysql//bin/mysqladmin -u root password 'new-password' |
| /usr/local/mysql//bin/mysqladmin -u root -h localhost.localdomain password 'new-password' |
| |
| Alternatively you can run: |
| |
| /usr/local/mysql//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 . ; /usr/local/mysql//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 http://bugs.mysql.com/ |
| |
| The latest information about MySQL is available on the web at |
| |
| http://www.mysql.com |
| |
| Support MySQL by buying support/licenses at http://shop.mysql.com |
| |
| WARNING: Found existing config file /usr/local/mysql//my.cnf on the system. |
| Because this file might be in use, it was not replaced, |
| but was used in bootstrap (unless you used --defaults-file) |
| and when you later start the server. |
| The new default config file was created as /usr/local/mysql//my-new.cnf, |
| please compare it with your file and take the changes you need. |
| |
| 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 |
| |
| [root@localhost bin] |
| mysqld_multi version 2.16 by Jani Tolonen |
| |
| Description: |
| mysqld_multi can be used to start, reload, or stop any number of separate |
| mysqld processes running in different TCP/IP ports and UNIX sockets. |
| |
| mysqld_multi can read group [mysqld_multi] from my.cnf file. You may |
| want to put options mysqld=... and mysqladmin=... there. Since |
| version 2.10 these options can also be given under groups [mysqld#], |
| which gives more control over different versions. One can have the |
| default mysqld and mysqladmin under group [mysqld_multi], but this is |
| not mandatory. Please note that if mysqld or mysqladmin is missing |
| from both [mysqld_multi] and [mysqld#], a group that is tried to be |
| used, mysqld_multi will abort with an error. |
| |
| mysqld_multi will search for groups named [mysqld#] from my.cnf (or |
| the given --defaults-extra-file=...), where '#' can be any positive |
| integer starting from 1. These groups should be the same as the regular |
| [mysqld] group, but with those port, socket and any other options |
| that are to be used with each separate mysqld process. The number |
| in the group name has another function; it can be used for starting, |
| reloading, stopping, or reporting any specific mysqld server. |
| |
| Usage: mysqld_multi [OPTIONS] {start|reload|stop|report} [GNR,GNR,GNR...] |
| or mysqld_multi [OPTIONS] {start|reload|stop|report} [GNR-GNR,GNR,GNR-GNR,...] |
| |
| The GNR means the group number. You can start, reload, stop or report any GNR, |
| or several of them at the same time. (See --example) The GNRs list can |
| be comma separated or a dash combined. The latter means that all the |
| GNRs between GNR1-GNR2 will be affected. Without GNR argument all the |
| groups found will either be started, reloaded, stopped, or reported. Note that |
| syntax for specifying GNRs must appear without spaces. |
| |
| Options: |
| |
| These options must be given before any others: |
| --no-defaults Do not read any defaults file |
| --defaults-file=... Read only this configuration file, do not read the |
| standard system-wide and user-specific files |
| --defaults-extra-file=... Read this configuration file in addition to the |
| standard system-wide and user-specific files |
| Using: |
| |
| --example Give an example of a config file with extra information. |
| --help Print this help and exit. |
| --log=... Log file. Full path to and the name for the log file. NOTE: |
| If the file exists, everything will be appended. |
| Using: |
| --mysqladmin=... mysqladmin binary to be used for a server shutdown. |
| Since version 2.10 this can be given within groups [mysqld#] |
| Using: |
| --mysqld=... mysqld binary to be used. Note that you can give mysqld_safe |
| to this option also. The options are passed to mysqld. Just |
| make sure you have mysqld in your PATH or fix mysqld_safe. |
| Using: |
| Please note: Since mysqld_multi version 2.3 you can also |
| give this option inside groups [mysqld#] in ~/.my.cnf, |
| where '#' stands for an integer (number) of the group in |
| question. This will be recognised as a special option and |
| will not be passed to the mysqld. This will allow one to |
| start different mysqld versions with mysqld_multi. |
| --no-log Print to stdout instead of the log file. By default the log |
| file is turned on. |
| --password=... Password for mysqladmin user. |
| --silent Disable warnings. |
| --tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead |
| of the UNIX socket. This affects stopping and reporting. |
| If a socket file is missing, the server may still be |
| running, but can be accessed only via the TCP/IP port. |
| By default connecting is done via the UNIX socket. |
| --user=... mysqladmin user. Using: root |
| --verbose Be more verbose. |
| --version Print the version number and exit. |
| |
| [root@localhost bin] |
| [root@localhost bin] |
| [root@localhost bin] |
| Reporting MySQL servers |
| MySQL server from group: mysqld3306 is running |
| MySQL server from group: mysqld3308 is running |
| 检查数据库是否开启 |
| [root@localhost bin] |
| root 34854 1 0 16:03 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --port=3306 --socket=/tmp/mysql.sock --basedir=/usr/local/mysql --datadir=/data/mysql_3306 --socket=/tmp/mysql_3306.sock --slow_query_log_file=/data/mysql_3306/slow.log --log-error=/data/mysql_3306/error.log --log-bin=/data/mysql_3306/mysql-bin --sync_binlog=1 --binlog_format=row --transaction_isolation=REPEATABLE-READ --innodb_buffer_pool_size=100m |
| mysql 35102 34854 1 16:03 pts/0 00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql_3306 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --slow-query-log-file=/data/mysql_3306/slow.log --log-bin=/data/mysql_3306/mysql-bin --sync-binlog=1 --binlog-format=row --transaction-isolation=REPEATABLE-READ --innodb-buffer-pool-size=100m --log-error=/data/mysql_3306/error.log --pid-file=/data/mysql_3306/localhost.localdomain.pid --socket=/tmp/mysql_3306.sock --port=3306 |
| root 35133 1 0 16:03 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --port=3308 --socket=/tmp/mysql.sock --basedir=/usr/local/mysql --datadir=/data/mysql_3308 --socket=/tmp/mysql_3308.sock --slow_query_log=1 --slow_query_log_file=/data/mysql_3308/slow.log --log-error=/data/mysql_3308/error.log --long_query_time=0.05 --log-bin=/data/mysql_3308/mysql-bin --sync_binlog=1 --binlog_cache_size=4M --default-storage-engine=InnoDB --binlog_format=row --transaction_isolation=REPEATABLE-READ --innodb_buffer_pool_size=100m |
| mysql 35441 35133 1 16:03 pts/0 00:00:02 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql_3308 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --slow-query-log=1 --slow-query-log-file=/data/mysql_3308/slow.log --long-query-time=0.05 --log-bin=/data/mysql_3308/mysql-bin --sync-binlog=1 --binlog-cache-size=4M --default-storage-engine=InnoDB --binlog-format=row --transaction-isolation=REPEATABLE-READ --innodb-buffer-pool-size=100m --log-error=/data/mysql_3308/error.log --pid-file=/data/mysql_3308/localhost.localdomain.pid --socket=/tmp/mysql_3308.sock --port=3308 |
| root 35486 1591 0 16:05 pts/0 00:00:00 grep mysql |
| |
| [root@localhost bin] |
| Welcome to the MySQL monitor. Commands end with ; or \g. |
| Your MySQL connection id is 2 |
| Server version: 5.6.16-log MySQL Community Server (GPL) |
| |
| Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| |
| Oracle is a registered trademark of Oracle Corporation and/or its |
| affiliates. Other names may be trademarks of their respective |
| owners. |
| |
| Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
| |
| mysql> show databases; |
| +--------------------+ |
| | Database | |
| +--------------------+ |
| | information_schema | |
| | mysql | |
| | performance_schema | |
| | test | |
| +--------------------+ |
| 4 rows in set (0.02 sec) |
| |
| mysql> |
| |
| [root@localhost bin] |
| Welcome to the MySQL monitor. Commands end with ; or \g. |
| Your MySQL connection id is 2 |
| Server version: 5.6.16-log MySQL Community Server (GPL) |
| |
| Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| |
| Oracle is a registered trademark of Oracle Corporation and/or its |
| affiliates. Other names may be trademarks of their respective |
| owners. |
| |
| Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
| |
| mysql> show databases; |
| +--------------------+ |
| | Database | |
| +--------------------+ |
| | information_schema | |
| | mysql | |
| | performance_schema | |
| | test | |
| +--------------------+ |
| 4 rows in set (0.00 sec) |
| |
| mysql> |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 终于写完轮子一部分:tcp代理 了,记录一下
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理