environment:
docker:Docker version 17.12.0-ce, build c97c6d6
windows:windows 10
docker-images:mysql/mysql-server latest
I user this command success to create a container,but auto stop a few seconds later:
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD="root" -e MYSQL_USER="sa" -e MYSQL_PASSWORD="123456" -v "/C/mysql/Config/my.cnf":/etc/my.cnf -v "/C/mysql/Data":/var/lib/mysql --name server mysql/mysql-server
docker logs server:
Starting MySQL 5.7.21-1.1.3
2018-02-11T12:53:22.120561Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-02-11T12:53:22.125276Z 0 [Note] mysqld (mysqld 5.7.21) starting as process 1 ...
2018-02-11T12:53:22.139968Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-02-11T12:53:22.140147Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-02-11T12:53:22.140221Z 0 [Note] InnoDB: Uses event mutexes
2018-02-11T12:53:22.140282Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-02-11T12:53:22.140345Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-02-11T12:53:22.140404Z 0 [Note] InnoDB: Using Linux native AIO
2018-02-11T12:53:22.141479Z 0 [Note] InnoDB: Number of pools: 1
2018-02-11T12:53:22.144262Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-02-11T12:53:22.146215Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-02-11T12:53:22.154759Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-11T12:53:22.158172Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-02-11T12:53:22.212129Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-11T12:53:22.304744Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-11T12:53:22.304989Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-11T12:53:22.307389Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-11T12:53:22.469757Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-02-11T12:53:22.481187Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-02-11T12:53:22.481622Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-02-11T12:53:22.482185Z 0 [Note] InnoDB: Waiting for purge to start
2018-02-11T12:53:22.533061Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 2552053
2018-02-11T12:53:22.533556Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-02-11T12:53:22.533812Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-02-11T12:53:22.591600Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180211 12:53:22
2018-02-11T12:53:22.600231Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-02-11T12:53:22.600407Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2018-02-11T12:53:22.606883Z 0 [Warning] CA certificate ca.pem is self signed.
2018-02-11T12:53:22.608530Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2018-02-11T12:53:22.611190Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-02-11T12:53:22.611373Z 0 [Note] IPv6 is available.
2018-02-11T12:53:22.611457Z 0 [Note] - '::' resolves to '::';
2018-02-11T12:53:22.611539Z 0 [Note] Server socket created on IP: '::'.
2018-02-11T12:53:22.620768Z 0 [ERROR] Can't start server : Bind on unix socket: Operation not permitted
2018-02-11T12:53:22.620942Z 0 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2018-02-11T12:53:22.621067Z 0 [ERROR] Aborting
2018-02-11T12:53:22.621204Z 0 [Note] Binlog end
2018-02-11T12:53:22.621421Z 0 [Note] Shutting down plugin 'ngram'
2018-02-11T12:53:22.621550Z 0 [Note] Shutting down plugin 'partition'
2018-02-11T12:53:22.621645Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2018-02-11T12:53:22.621744Z 0 [Note] Shutting down plugin 'ARCHIVE'
2018-02-11T12:53:22.621832Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2018-02-11T12:53:22.621993Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2018-02-11T12:53:22.622088Z 0 [Note] Shutting down plugin 'MyISAM'
2018-02-11T12:53:22.622199Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2018-02-11T12:53:22.622266Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2018-02-11T12:53:22.622314Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2018-02-11T12:53:22.622378Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2018-02-11T12:53:22.622426Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2018-02-11T12:53:22.622488Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2018-02-11T12:53:22.622536Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2018-02-11T12:53:22.622599Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2018-02-11T12:53:22.622647Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2018-02-11T12:53:22.622724Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2018-02-11T12:53:22.622773Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2018-02-11T12:53:22.622837Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2018-02-11T12:53:22.622885Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2018-02-11T12:53:22.622947Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2018-02-11T12:53:22.623031Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2018-02-11T12:53:22.623087Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2018-02-11T12:53:22.623143Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2018-02-11T12:53:22.623197Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2018-02-11T12:53:22.623254Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2018-02-11T12:53:22.623308Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2018-02-11T12:53:22.623363Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2018-02-11T12:53:22.623418Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2018-02-11T12:53:22.623474Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2018-02-11T12:53:22.623528Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2018-02-11T12:53:22.623648Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2018-02-11T12:53:22.623753Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2018-02-11T12:53:22.623845Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2018-02-11T12:53:22.623953Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2018-02-11T12:53:22.624004Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-02-11T12:53:22.624068Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-02-11T12:53:22.624116Z 0 [Note] Shutting down plugin 'InnoDB'
2018-02-11T12:53:22.624273Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-02-11T12:53:22.624454Z 0 [Note] InnoDB: Starting shutdown...
2018-02-11T12:53:22.724955Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2018-02-11T12:53:22.739902Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180211 12:53:22
2018-02-11T12:53:24.348445Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2552072
2018-02-11T12:53:24.352699Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-11T12:53:24.353012Z 0 [Note] Shutting down plugin 'MEMORY'
2018-02-11T12:53:24.353110Z 0 [Note] Shutting down plugin 'CSV'
2018-02-11T12:53:24.353214Z 0 [Note] Shutting down plugin 'sha256_password'
2018-02-11T12:53:24.353308Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-02-11T12:53:24.353542Z 0 [Note] Shutting down plugin 'binlog'
2018-02-11T12:53:24.357751Z 0 [Note] mysqld: Shutdown complete
I had set dir "C:/mysql/" permission for everyone,how should i do? or forgot something?
permission
docker ps -a
thanks for Ahab help,When I Add tab ":rw"
still the same result
Can't start server : Bind on unix socket: Operation not permitted
result1result2
According to https://dev.mysql.com/doc/refman/5.7/en/deploy-mysql-nonlinux-docker.html:
Quote:
If you are bind-mounting on the container's MySQL data directory (see Persisting Data and Configuration Changes for details), you have to set the location of the server socket file with the --socket option to somewhere outside of the MySQL data directory; otherwise, the server will fail to start. This is because the way Docker for Windows handles file mounting does not allow a host file from being bind-mounted on the socket file.
I had to use a docker volume to solve this issue on win 10, the compose file is given below
version: '3'
services:
webapp:
build:
context: .
dockerfile: Dockerfile-webapp
image: webapp
privileged: true
volumes:
- ./app:/var/www/html/app
- ./httpd.conf:/etc/httpd/conf/httpd.conf
ports:
- "8080:80"
environment:
- dockerenv=true
links:
- dbserver:dbserver
dbserver:
image: percona:5.6.41
restart: always
environment:
MYSQL_ROOT_PASSWORD:
ports:
- "3306:3306"
volumes:
- dockerdbdata:/var/lib/mysql
- ./query/init.sql:/docker-entrypoint-initdb.d/init.sql
privileged: true
volumes:
dockerdbdata:
Related
I'm trying to drop a few columns from a fairly large table in my database (about 110GB) and it seems like the server is freezing. After creating a (journal?) file called something similar to #sql-ib43-1640985772.ibd, which grows to about the same size as the table, the file sizes stop changing and nothing seems to be happening, even though I still see high CPU and disk writes about 10MB/s from mysqld, though absolutely 0B/s in reads. It sat like this for over an hour, then I cancelled the query and tried it again, now its been stuck at the same point for a while.
I'm using the default config file, except I have updated innodb-buffer-pool-size = 54G since my system has 64GB RAM.
Table structure
mysql> show create table tx_out2;
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tx_out2 | CREATE TABLE `tx_out2` (
`txid` tinytext,
`indexOut` int(8) DEFAULT NULL,
`btc_value` double DEFAULT NULL,
`scriptPubKey` tinytext,
`address` tinytext
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
Count of records
mysql> select count(*) from tx_out2;
695377848
The query its running
ALTER TABLE tx_out2
DROP COLUMN indexOut, DROP COLUMN scriptPubKey;
I don't see anything interesting in the mysql.log, but I'm gonna dump my error.log in case I've missed something.
2017-10-16T11:36:51.445140Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4107ms. The settings might not be optimal. (flushed=0 and evicted=7932, during the time
.)
2017-10-16T11:37:48.064416Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4089ms. The settings might not be optimal. (flushed=0 and evicted=8192, during the time
.)
2017-10-16T11:38:26.360996Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4177ms. The settings might not be optimal. (flushed=0 and evicted=8192, during the time
.)
2017-10-16T11:40:04.313444Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4218ms. The settings might not be optimal. (flushed=0 and evicted=8192, during the time
.)
2017-10-16T11:42:27.768420Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4308ms. The settings might not be optimal. (flushed=0 and evicted=8004, during the time
.)
2017-10-16T12:57:27.170952Z 0 [Note] Giving 1 client threads a chance to die gracefully
2017-10-16T12:57:27.171139Z 0 [Note] Shutting down slave threads
2017-10-16T12:57:29.171455Z 0 [Note] Forcefully disconnecting 1 remaining clients
2017-10-16T12:57:29.171515Z 0 [Warning] /usr/sbin/mysqld: Forcing close of thread 8 user: 'root'
2017-10-16T12:57:29.171588Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2017-10-16T12:57:29.172163Z 0 [Note] Binlog end
2017-10-16T12:57:29.186138Z 0 [Note] Shutting down plugin 'ngram'
2017-10-16T12:57:29.186172Z 0 [Note] Shutting down plugin 'partition'
2017-10-16T12:57:29.186182Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-10-16T12:57:29.186191Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-10-16T12:57:29.186198Z 0 [Note] Shutting down plugin 'CSV'
2017-10-16T12:57:29.186208Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2017-10-16T12:57:29.186336Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-10-16T12:57:29.186367Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-10-16T12:57:29.186376Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-10-16T12:57:29.186384Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-10-16T12:57:29.186391Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-10-16T12:57:29.186398Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-10-16T12:57:29.186423Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-10-16T12:57:29.186430Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-10-16T12:57:29.186436Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-10-16T12:57:29.186442Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-10-16T12:57:29.186448Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-10-16T12:57:29.186454Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-10-16T12:57:29.186461Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-10-16T12:57:29.186467Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-10-16T12:57:29.186473Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-10-16T12:57:29.186479Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2017-10-16T12:57:29.186485Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2017-10-16T12:57:29.186491Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-10-16T12:57:29.186497Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-10-16T12:57:29.186503Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-10-16T12:57:29.186509Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-10-16T12:57:29.186516Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-10-16T12:57:29.186522Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-10-16T12:57:29.186528Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-10-16T12:57:29.186534Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-10-16T12:57:29.186540Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-10-16T12:57:29.186546Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-10-16T12:57:29.186552Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-10-16T12:57:29.186558Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2017-10-16T12:57:29.186564Z 0 [Note] Shutting down plugin 'InnoDB'
2017-10-16T12:57:29.186659Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-10-16T12:57:29.186909Z 0 [Note] InnoDB: Starting shutdown...
2017-10-16T12:57:29.288209Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2017-10-16T12:57:29.493814Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 171016 8:57:29
2017-10-16T12:57:35.879563Z 0 [Note] InnoDB: Shutdown completed; log sequence number 350941746874
2017-10-16T12:57:35.879867Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-10-16T12:57:35.879979Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-10-16T12:57:35.880472Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-10-16T12:57:35.880477Z 0 [Note] Shutting down plugin 'MyISAM'
2017-10-16T12:57:35.880575Z 0 [Note] Shutting down plugin 'MEMORY'
2017-10-16T12:57:35.880577Z 0 [Note] Shutting down plugin 'sha256_password'
2017-10-16T12:57:35.880579Z 0 [Note] Shutting down plugin 'mysql_native_password'
2017-10-16T12:57:35.882166Z 0 [Note] Shutting down plugin 'binlog'
2017-10-16T12:57:35.882618Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2017-10-16T12:57:35.997070Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-10-16T12:57:35.997103Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-10-16T12:57:36.130275Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-10-16T12:57:36.131185Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.19-0ubuntu0.16.04.1-log) starting as process 14818 ...
2017-10-16T12:57:36.136951Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-10-16T12:57:36.136970Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-10-16T12:57:36.136973Z 0 [Note] InnoDB: Uses event mutexes
2017-10-16T12:57:36.136975Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-10-16T12:57:36.136978Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-10-16T12:57:36.136980Z 0 [Note] InnoDB: Using Linux native AIO
2017-10-16T12:57:36.137117Z 0 [Note] InnoDB: Number of pools: 1
2017-10-16T12:57:36.137179Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-10-16T12:57:36.137939Z 0 [Note] InnoDB: Initializing buffer pool, total size = 54G, instances = 8, chunk size = 128M
2017-10-16T12:57:37.833908Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-10-16T12:57:37.926601Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-10-16T12:57:37.939931Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-10-16T12:57:38.305711Z 0 [Warning] InnoDB: Resizing redo log from 2*32768 to 2*3072 pages, LSN=350941746883
2017-10-16T12:57:38.421912Z 0 [Warning] InnoDB: Starting to delete and rewrite log files.
2017-10-16T12:57:38.519476Z 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2017-10-16T12:57:38.591866Z 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2017-10-16T12:57:38.704063Z 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2017-10-16T12:57:38.704167Z 0 [Warning] InnoDB: New log files created, LSN=350941746883
2017-10-16T12:57:38.704600Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-10-16T12:57:38.704666Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-10-16T12:57:38.739187Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-10-16T12:57:38.740727Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-10-16T12:57:38.740750Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-10-16T12:57:38.741403Z 0 [Note] InnoDB: 5.7.19 started; log sequence number 350941746874
2017-10-16T12:57:38.742225Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-10-16T12:57:38.742678Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-10-16T12:57:38.751873Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-10-16T12:57:38.751905Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2017-10-16T12:57:38.751921Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2017-10-16T12:57:38.751952Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2017-10-16T12:57:38.781275Z 0 [Note] Event Scheduler: Loaded 0 events
2017-10-16T12:57:38.781430Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.19-0ubuntu0.16.04.1-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
2017-10-16T12:57:38.781441Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
2017-10-16T12:57:38.781445Z 0 [Note] Beginning of list of non-natively partitioned tables
2017-10-16T12:57:38.800160Z 0 [Note] End of list of non-natively partitioned tables
2017-10-16T12:57:39.006214Z 3 [Note] Access denied for user 'root'#'localhost' (using password: NO)
2017-10-16T12:57:44.574183Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171016 8:57:44
Thanks for any help diagnosing this, it seems highly unusual and I'm worried I'm waiting for nothing.
The operation finally completed after more than 3 hours. I suspect I have a major bottleneck somewhere but I'm not sure where as CPU and IO seemed normal.
edit: I got a much better answer on Stack Exchange after being advised this question wasn't appropriate for Stack Overflow, including so others can learn from the wisdom of Rick James.
Mac El Capitan (10.11.6) here. I installed MySQL via homebrew (brew install mysql, which installed 5.7.17) and was able to get it started with defaults (absolutely zero configuration to my.cnf). I was able to create a database with tables, populate them, etc.
I open ~/.my.cnf and see that its empty, which makes sense seeing that I never added any special configs to it in the first place.
So I add (to this empty file):
[mysqld]
default-storage-engine = innodb
default-character-set=utf8
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
I then run mysql.server start to start MySQL and:
mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/var/mysql/MyUsername.local.pid).
If I clear (and make empty again) the contents of ~/.my.cnf and restart MySQL, it starts up perfectly fine (no errors; I can query tables, etc.). But if I add those contents back in, I get the same error.
So clearly MySQL is checking ~/.my.cnf for configs to load, and clearly there's something about that syntax it doesn't like. So I start a series of config/test cycles to see which property is the offender.
I change ~/.my.cnf to:
[mysqld]
default-storage-engine = innodb
And restart. Same exact error.
I change ~/.my.cnf to:
[mysqld]
default-character-set=utf8
And restart. Same exact error.
I change ~/.my.cnf to:
[mysqld]
collation-server = utf8_unicode_ci
And restart. Same exact error.
I change ~/.my.cnf to:
[mysqld]
init-connect='SET NAMES utf8'
And restart. Same exact error. Clearly something else is going on here. MySQL doesn't like it when I specify any configurations inside ~/.my.cnf. What's going on here?!?
I tried following all the recommendations in this article but none of them worked. Definitely seems like a MacOS/MySQL issue.
If I open /usr/local/var/mysql/MyUser.local.err I see:
2017-04-13T13:10:42.6NZ mysqld_safe Logging to '/usr/local/var/mysql/MyUser.local.err'.
2017-04-13T13:10:42.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2017-04-13T13:10:42.365982Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-04-13T13:10:42.366238Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-04-13T13:10:42.366286Z 0 [Note] /usr/local/Cellar/mysql/5.7.17/bin/mysqld (mysqld 5.7.17) starting as process 56561 ...
2017-04-13T13:10:42.369426Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2017-04-13T13:10:42.371041Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-04-13T13:10:42.371058Z 0 [Note] InnoDB: Uses event mutexes
2017-04-13T13:10:42.371062Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-04-13T13:10:42.371066Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-04-13T13:10:42.371389Z 0 [Note] InnoDB: Number of pools: 1
2017-04-13T13:10:42.371487Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-04-13T13:10:42.373341Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-04-13T13:10:42.385062Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-04-13T13:10:42.402413Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-04-13T13:10:42.456473Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-04-13T13:10:42.456722Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-04-13T13:10:42.498060Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-04-13T13:10:42.499778Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-04-13T13:10:42.499807Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-04-13T13:10:42.500089Z 0 [Note] InnoDB: Waiting for purge to start
2017-04-13T13:10:42.550861Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 6305962580
2017-04-13T13:10:42.551099Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/var/mysql/ib_buffer_pool
2017-04-13T13:10:42.551345Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-04-13T13:10:42.555196Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170413 13:10:42
2017-04-13T13:10:42.559085Z 0 [ERROR] unknown variable 'default-character-set=utf8'
2017-04-13T13:10:42.559125Z 0 [ERROR] Aborting
2017-04-13T13:10:42.559139Z 0 [Note] Binlog end
2017-04-13T13:10:42.559221Z 0 [Note] Shutting down plugin 'ngram'
2017-04-13T13:10:42.559253Z 0 [Note] Shutting down plugin 'partition'
2017-04-13T13:10:42.559266Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-04-13T13:10:42.559300Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-04-13T13:10:42.559311Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-04-13T13:10:42.559387Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-04-13T13:10:42.559406Z 0 [Note] Shutting down plugin 'MyISAM'
2017-04-13T13:10:42.559430Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2017-04-13T13:10:42.559439Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-04-13T13:10:42.559443Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-04-13T13:10:42.559447Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-04-13T13:10:42.559450Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-04-13T13:10:42.559453Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-04-13T13:10:42.559457Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-04-13T13:10:42.559460Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-04-13T13:10:42.559464Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-04-13T13:10:42.559467Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-04-13T13:10:42.559473Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-04-13T13:10:42.559477Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-04-13T13:10:42.559510Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-04-13T13:10:42.559514Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-04-13T13:10:42.559517Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-04-13T13:10:42.559523Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-04-13T13:10:42.559529Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2017-04-13T13:10:42.559535Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2017-04-13T13:10:42.559539Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-04-13T13:10:42.559543Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-04-13T13:10:42.559546Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-04-13T13:10:42.559550Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-04-13T13:10:42.559588Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-04-13T13:10:42.559608Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-04-13T13:10:42.559622Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-04-13T13:10:42.559629Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-04-13T13:10:42.559635Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-04-13T13:10:42.559640Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-04-13T13:10:42.559665Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-04-13T13:10:42.559674Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2017-04-13T13:10:42.559681Z 0 [Note] Shutting down plugin 'InnoDB'
2017-04-13T13:10:42.559742Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-04-13T13:10:42.559798Z 0 [Note] InnoDB: Starting shutdown...
2017-04-13T13:10:42.665019Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/var/mysql/ib_buffer_pool
2017-04-13T13:10:42.665949Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170413 13:10:42
2017-04-13T13:10:44.125226Z 0 [Note] InnoDB: Shutdown completed; log sequence number 6305962599
2017-04-13T13:10:44.126507Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-04-13T13:10:44.126528Z 0 [Note] Shutting down plugin 'MEMORY'
2017-04-13T13:10:44.126540Z 0 [Note] Shutting down plugin 'CSV'
2017-04-13T13:10:44.126545Z 0 [Note] Shutting down plugin 'sha256_password'
2017-04-13T13:10:44.126549Z 0 [Note] Shutting down plugin 'mysql_native_password'
2017-04-13T13:10:44.126701Z 0 [Note] Shutting down plugin 'binlog'
2017-04-13T13:10:44.126824Z 0 [Note] /usr/local/Cellar/mysql/5.7.17/bin/mysqld: Shutdown complete
2017-04-13T13:10:44.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/MyUser.local.pid ended
Regarding character-set: what you write may be no longer allowed.
See Change MySQL default character set to UTF-8 in my.cnf
I tried to install MySQL 5.7 on a redhat server without root permission. I downloaded the source code and it compiled and installed smoothly. But when I run mysqld it always pop out error.
I followed the instruction on
http://www.martijn-onderwater.nl/2010/11/23/installing-mysql-on-linux-without-root-privileges/
and I created a my.cnf file
[mysqld]
port=3306
socket=/afs/crc.nd.edu/user/j/jlai1/MySQL/thesock
basedir=/afs/crc.nd.edu/user/j/jlai1/MySQL
datadir=data
pid-file=$HOME/MySQL/mysql.pid
user=root
[client]
port=3306
socket=$MySQL_HOME/thesock
user=root
[mysqladmin]
socket=$MySQL_HOME/thesock
user=root
when I run ./bin/mysqld --defaults-file=my.cnf --initialize, it works fine. But I got the following problem
./bin/mysqld --defaults-file=my.cnf
2017-02-24T16:04:40.098102Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-02-24T16:04:40.098259Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-02-24T16:04:40.098302Z 0 [Note] ./bin/mysqld (mysqld 5.7.17) starting as process 1786 ...
2017-02-24T16:04:40.103470Z 0 [Warning] One can only use the --user switch if running as root
2017-02-24T16:04:40.105092Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-02-24T16:04:40.105121Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-02-24T16:04:40.105128Z 0 [Note] InnoDB: Uses event mutexes
2017-02-24T16:04:40.105137Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-02-24T16:04:40.105143Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-02-24T16:04:40.105466Z 0 [Note] InnoDB: Number of pools: 1
2017-02-24T16:04:40.105593Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-02-24T16:04:40.106782Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-02-24T16:04:40.115005Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-02-24T16:04:40.117871Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-02-24T16:04:40.133076Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-02-24T16:04:40.150182Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-02-24T16:04:40.150804Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-02-24T16:04:40.279174Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-02-24T16:04:40.280871Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-02-24T16:04:40.280904Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-02-24T16:04:40.281963Z 0 [Note] InnoDB: Waiting for purge to start
2017-02-24T16:04:40.332115Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 2534599
2017-02-24T16:04:40.332297Z 0 [Note] InnoDB: Loading buffer pool(s) from /afs/crc.nd.edu/user/j/jlai1/MySQL/data/ib_buffer_pool
2017-02-24T16:04:40.332547Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-02-24T16:04:40.337533Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170224 11:04:40
2017-02-24T16:04:40.340352Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-02-24T16:04:40.340424Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-02-24T16:04:40.342270Z 0 [Note] IPv6 is not available.
2017-02-24T16:04:40.342313Z 0 [Note] - '0.0.0.0' resolves to '0.0.0.0';
2017-02-24T16:04:40.342355Z 0 [Note] Server socket created on IP: '0.0.0.0'.
2017-02-24T16:04:40.344528Z 0 [ERROR] Can't start server : Bind on unix socket: Operation not permitted
2017-02-24T16:04:40.344546Z 0 [ERROR] Do you already have another mysqld server running on socket: /afs/crc.nd.edu/user/j/jlai1/MySQL/thesock ?
2017-02-24T16:04:40.344563Z 0 [ERROR] Aborting
2017-02-24T16:04:40.344584Z 0 [Note] Binlog end
2017-02-24T16:04:40.344674Z 0 [Note] Shutting down plugin 'ngram'
2017-02-24T16:04:40.344686Z 0 [Note] Shutting down plugin 'partition'
2017-02-24T16:04:40.344692Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-02-24T16:04:40.344699Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-02-24T16:04:40.344704Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-02-24T16:04:40.344805Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-02-24T16:04:40.344813Z 0 [Note] Shutting down plugin 'MyISAM'
2017-02-24T16:04:40.344830Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2017-02-24T16:04:40.344835Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-02-24T16:04:40.344840Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-02-24T16:04:40.344844Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-02-24T16:04:40.344849Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-02-24T16:04:40.344853Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-02-24T16:04:40.344858Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-02-24T16:04:40.344862Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-02-24T16:04:40.344866Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-02-24T16:04:40.344871Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-02-24T16:04:40.344875Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-02-24T16:04:40.344880Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-02-24T16:04:40.344895Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-02-24T16:04:40.344899Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-02-24T16:04:40.344904Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-02-24T16:04:40.344908Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-02-24T16:04:40.344913Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2017-02-24T16:04:40.344917Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2017-02-24T16:04:40.344921Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-02-24T16:04:40.344926Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-02-24T16:04:40.344932Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-02-24T16:04:40.344936Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-02-24T16:04:40.344941Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-02-24T16:04:40.344946Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-02-24T16:04:40.344951Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-02-24T16:04:40.344955Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-02-24T16:04:40.344960Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-02-24T16:04:40.344964Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-02-24T16:04:40.344969Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-02-24T16:04:40.344973Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2017-02-24T16:04:40.344978Z 0 [Note] Shutting down plugin 'InnoDB'
2017-02-24T16:04:40.345065Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-02-24T16:04:40.345135Z 0 [Note] InnoDB: Starting shutdown...
2017-02-24T16:04:40.445348Z 0 [Note] InnoDB: Dumping buffer pool(s) to /afs/crc.nd.edu/user/j/jlai1/MySQL/data/ib_buffer_pool
2017-02-24T16:04:40.447661Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170224 11:04:40
2017-02-24T16:04:41.779942Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2534618
2017-02-24T16:04:41.795993Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-02-24T16:04:41.796030Z 0 [Note] Shutting down plugin 'MEMORY'
2017-02-24T16:04:41.796045Z 0 [Note] Shutting down plugin 'CSV'
2017-02-24T16:04:41.796092Z 0 [Note] Shutting down plugin 'sha256_password'
2017-02-24T16:04:41.796105Z 0 [Note] Shutting down plugin 'mysql_native_password'
2017-02-24T16:04:41.796375Z 0 [Note] Shutting down plugin 'binlog'
2017-02-24T16:04:41.796973Z 0 [Note] ./bin/mysqld: Shutdown complete
The problem seems that your user dont have permission to bind a port, 3306 specifically for Mysql.
I was using an old MySql 5.0 installation. Then decided to get newest 5.7 .zip release.
This is what I have done:
mysqld -initialize-insecure
(As I intend to use this for localhost/root usage only)
This creates some files in the root of the MySQL data directory.
However, running
mysqld --console
gives error
2017-02-03T02:52:01.076801Z 0 [ERROR] Fatal error: Can't open and lock
privilege tables: Table 'mysql.user' doesn't exis
I then intended to move over my two 5.0 databases (each in a subfolder in my old mysql 5.0 "data dir" directory.)
Possibly I could then run mysql_upgrade then?
My full error log is here:
D:\databases\MySQL-5_7(x86)\bin>mysqld --console
2017-02-03T02:52:00.227754Z 0 [Warning] TIMESTAMP with implicit
DEFAULT value is deprecated. Please use
--explicit_defaults_for_timestamp server option (see documentation for more details). 2017-02-03T02:52:00.227754Z 0 [Warning] 'NO_ZERO_DATE',
'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be
used with strict mode. They will be merged with strict mode in a
future release. 2017-02-03T02:52:00.227754Z 0 [Warning]
'NO_AUTO_CREATE_USER' sql mode was not set.
2017-02-03T02:52:00.227754Z 0 [Note] --secure-file-priv is set to
NULL. Operations related to importing and exporting data are disabled
2017-02-03T02:52:00.227754Z 0 [Note] mysqld (mysqld 5.7.17) starting
as process 13872 ... 2017-02-03T02:52:00.235754Z 0 [Note] InnoDB:
Mutexes and rw_locks use Windows interlocked functions
2017-02-03T02:52:00.236754Z 0 [Note] InnoDB: Uses event mutexes
2017-02-03T02:52:00.236754Z 0 [Note] InnoDB: Memory barrier is not
used 2017-02-03T02:52:00.237754Z 0 [Note] InnoDB: Compressed tables
use zlib 1.2.3 2017-02-03T02:52:00.237754Z 0 [Note] InnoDB: Number of
pools: 1 2017-02-03T02:52:00.238755Z 0 [Note] InnoDB: Not using CPU
crc32 instructions 2017-02-03T02:52:00.240755Z 0 [Note] InnoDB:
Initializing buffer pool, total size = 128M, instances = 1, chunk size
= 128M 2017-02-03T02:52:00.249755Z 0 [Note] InnoDB: Completed initialization of buffer pool 2017-02-03T02:52:00.363762Z 0 [Note]
InnoDB: Highest supported file format is Barracuda.
2017-02-03T02:52:00.498769Z 0 [Note] InnoDB: Creating shared
tablespace for temporary tables 2017-02-03T02:52:00.499769Z 0 [Note]
InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the
file full; Please wait ... 2017-02-03T02:52:00.745783Z 0 [Note]
InnoDB: File '.\ibtmp1' size is now 12 MB. 2017-02-03T02:52:00.933793Z
0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback
segment(s) are active. 2017-02-03T02:52:00.934792Z 0 [Note] InnoDB: 32
non-redo rollback segment(s) are active. 2017-02-03T02:52:00.936793Z 0
[Note] InnoDB: Waiting for purge to start 2017-02-03T02:52:00.988797Z
0 [Note] InnoDB: 5.7.17 started; log sequence number 1209961
2017-02-03T02:52:00.988797Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-02-03T02:52:00.990797Z 0 [Note] InnoDB: Loading buffer pool(s)
from W:\b-databases\MySql\5.0.x\data\ib_buffer_pool mysqld: Table
'mysql.plugin' doesn't exist 2017-02-03T02:52:00.991796Z 0 [ERROR]
Can't open the mysql.plugin table. Please run mysql_upgrade to create
it. 2017-02-03T02:52:00.993796Z 0 [Note] Salting uuid generator
variables, current_pid: 13872, server_start_time: 1486090320,
bytes_sent: 0, 2017-02-03T02:52:00.993796Z 0 [Note] InnoDB: Buffer
pool(s) load completed at 170203 3:52:00 2017-02-03T02:52:00.997796Z
0 [Note] Generated uuid: 'bc608dfe-e9bb-11e6-b692-00248c156225',
server_start_time: 1486104192, bytes_sent: 361844000
2017-02-03T02:52:00.997796Z 0 [Warning] No existing UUID has been
found, so we assume that this is the first time that this server has
been started. Generating a new UUID:
bc608dfe-e9bb-11e6-b692-00248c156225. 2017-02-03T02:52:01.041799Z 0
[Warning] Gtid table is not ready to be used. Table
'mysql.gtid_executed' cannot be opened. 2017-02-03T02:52:01.041799Z 0
[Warning] Failed to set up SSL because of the following SSL library
error: SSL context is not usable without certificate and private key
2017-02-03T02:52:01.043799Z 0 [Note] Server hostname (bind-address):
'*'; port: 3306 2017-02-03T02:52:01.044802Z 0 [Note] IPv6 is
available. 2017-02-03T02:52:01.045801Z 0 [Note] - '::' resolves to
'::'; 2017-02-03T02:52:01.045801Z 0 [Note] Server socket created on
IP: '::'. 2017-02-03T02:52:01.054800Z 0 [Warning] Failed to open
optimizer cost constant tables
2017-02-03T02:52:01.076801Z 0 [ERROR] Fatal error: Can't open and lock
privilege tables: Table 'mysql.user' doesn't exist
2017-02-03T02:52:01.077801Z 0 [ERROR] Aborting
2017-02-03T02:52:01.078801Z 0 [Note] Binlog end
2017-02-03T02:52:01.079801Z 0 [Note] Shutting down plugin 'ngram'
2017-02-03T02:52:01.079801Z 0 [Note] Shutting down plugin 'partition'
2017-02-03T02:52:01.080801Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-02-03T02:52:01.081801Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-02-03T02:52:01.081801Z 0 [Note] Shutting down plugin
'PERFORMANCE_SCHEMA' 2017-02-03T02:52:01.082801Z 0 [Note] Shutting
down plugin 'MRG_MYISAM' 2017-02-03T02:52:01.082801Z 0 [Note] Shutting
down plugin 'MyISAM' 2017-02-03T02:52:01.083801Z 0 [Note] Shutting
down plugin 'INNODB_SYS_VIRTUAL' 2017-02-03T02:52:01.083801Z 0 [Note]
Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-02-03T02:52:01.084801Z 0 [Note] Shutting down plugin
'INNODB_SYS_TABLESPACES' 2017-02-03T02:52:01.084801Z 0 [Note] Shutting
down plugin 'INNODB_SYS_FOREIGN_COLS' 2017-02-03T02:52:01.085801Z 0
[Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-02-03T02:52:01.087801Z 0 [Note] Shutting down plugin
'INNODB_SYS_FIELDS' 2017-02-03T02:52:01.088802Z 0 [Note] Shutting down
plugin 'INNODB_SYS_COLUMNS' 2017-02-03T02:52:01.089802Z 0 [Note]
Shutting down plugin 'INNODB_SYS_INDEXES' 2017-02-03T02:52:01.089802Z
0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-02-03T02:52:01.090802Z 0 [Note] Shutting down plugin
'INNODB_SYS_TABLES' 2017-02-03T02:52:01.091802Z 0 [Note] Shutting down
plugin 'INNODB_FT_INDEX_TABLE' 2017-02-03T02:52:01.091802Z 0 [Note]
Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-02-03T02:52:01.092802Z 0 [Note] Shutting down plugin
'INNODB_FT_CONFIG' 2017-02-03T02:52:01.093802Z 0 [Note] Shutting down
plugin 'INNODB_FT_BEING_DELETED' 2017-02-03T02:52:01.093802Z 0 [Note]
Shutting down plugin 'INNODB_FT_DELETED' 2017-02-03T02:52:01.094802Z 0
[Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-02-03T02:52:01.094802Z 0 [Note] Shutting down plugin
'INNODB_METRICS' 2017-02-03T02:52:01.095802Z 0 [Note] Shutting down
plugin 'INNODB_TEMP_TABLE_INFO' 2017-02-03T02:52:01.097802Z 0 [Note]
Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-02-03T02:52:01.098802Z 0 [Note] Shutting down plugin
'INNODB_BUFFER_PAGE_LRU' 2017-02-03T02:52:01.099802Z 0 [Note] Shutting
down plugin 'INNODB_BUFFER_PAGE' 2017-02-03T02:52:01.099802Z 0 [Note]
Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-02-03T02:52:01.100802Z 0 [Note] Shutting down plugin
'INNODB_CMP_PER_INDEX' 2017-02-03T02:52:01.100802Z 0 [Note] Shutting
down plugin 'INNODB_CMPMEM_RESET' 2017-02-03T02:52:01.101802Z 0 [Note]
Shutting down plugin 'INNODB_CMPMEM' 2017-02-03T02:52:01.102802Z 0
[Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-02-03T02:52:01.102802Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-02-03T02:52:01.103803Z 0 [Note] Shutting down plugin
'INNODB_LOCK_WAITS' 2017-02-03T02:52:01.103803Z 0 [Note] Shutting down
plugin 'INNODB_LOCKS' 2017-02-03T02:52:01.104802Z 0 [Note] Shutting
down plugin 'INNODB_TRX' 2017-02-03T02:52:01.104802Z 0 [Note] Shutting
down plugin 'InnoDB' 2017-02-03T02:52:01.105803Z 0 [Note] InnoDB: FTS
optimize thread exiting. 2017-02-03T02:52:01.107803Z 0 [Note] InnoDB:
Starting shutdown... 2017-02-03T02:52:01.209808Z 0 [Note] InnoDB:
Dumping buffer pool(s) to
W:\b-databases\MySql\5.0.x\data\ib_buffer_pool
2017-02-03T02:52:01.214809Z 0 [Note] InnoDB: Buffer pool(s) dump
completed at 170203 3:52:01 2017-02-03T02:52:02.408874Z 0 [Note]
InnoDB: Shutdown completed; log sequence number 1209980
2017-02-03T02:52:02.408874Z 0 [Note] InnoDB: Removed temporary
tablespace data file: "ibtmp1" 2017-02-03T02:52:02.409874Z 0 [Note]
Shutting down plugin 'MEMORY' 2017-02-03T02:52:02.410874Z 0 [Note]
Shutting down plugin 'CSV' 2017-02-03T02:52:02.410874Z 0 [Note]
Shutting down plugin 'sha256_password' 2017-02-03T02:52:02.411874Z 0
[Note] Shutting down plugin 'mysql_native_password'
2017-02-03T02:52:02.412874Z 0 [Note] Shutting down plugin 'binlog'
2017-02-03T02:52:02.412874Z 0 [Note] mysqld: Shutdown complete
And this is my.ini file:
[mysqld]
basedir=D:/databases/MySQL-5_7(x86)
datadir=W:/b-databases/MySql/5.0.x/data
port=3306
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Somehow I got it working now - I redid what was mentioned here and this time the user tables were created as well. Not quite sure why it did not work befoe, but still deserves to be an answer:
https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html
MySQL version - 5.7.11
I am unable to run mysql server on my windows 10 even after running command prompt as an administrator and marking run as administrator in the exe files for mysql and mysqld.
Following are the contents of log file present in the data directory -
2016-02-28T18:44:37.478791Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-02-28T18:44:37.479292Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2016-02-28T18:44:37.480293Z 0 [Note] mysqld (mysqld 5.7.11) starting as process 504 ...
2016-02-28T18:44:37.643005Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-02-28T18:44:37.644506Z 0 [Note] InnoDB: Uses event mutexes
2016-02-28T18:44:37.645507Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2016-02-28T18:44:37.646508Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-28T18:44:37.651010Z 0 [Note] InnoDB: Number of pools: 1
2016-02-28T18:44:37.655562Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-28T18:44:37.716605Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-02-28T18:44:37.736603Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-02-28T18:44:37.757664Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2016-02-28T18:44:37.760134Z 0 [Note] InnoDB: Setting file '.\ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
2016-02-28T18:44:37.956704Z 0 [Note] InnoDB: File '.\ibdata1' size is now 12 MB.
2016-02-28T18:44:38.047061Z 0 [Note] InnoDB: Setting log file .\ib_logfile101 size to 48 MB
2016-02-28T18:44:38.500757Z 0 [Note] InnoDB: Setting log file .\ib_logfile1 size to 48 MB
2016-02-28T18:44:39.211654Z 0 [Note] InnoDB: Renaming log file .\ib_logfile101 to .\ib_logfile0
2016-02-28T18:44:39.226714Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-02-28T18:44:39.226714Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-02-28T18:44:39.226714Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-02-28T18:44:39.423633Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2016-02-28T18:44:39.477796Z 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-02-28T18:44:39.657048Z 0 [Note] InnoDB: Doublewrite buffer created
2016-02-28T18:44:39.703088Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-02-28T18:44:39.704591Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-02-28T18:44:39.731614Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-02-28T18:44:39.975606Z 0 [Note] InnoDB: Foreign key constraint system tables created
2016-02-28T18:44:39.977607Z 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-02-28T18:44:40.036710Z 0 [Note] InnoDB: Tablespace and datafile system tables created.
2016-02-28T18:44:40.036710Z 0 [Note] InnoDB: Creating sys_virtual system tables.
2016-02-28T18:44:40.132743Z 0 [Note] InnoDB: sys_virtual table created
2016-02-28T18:44:40.134252Z 0 [Note] InnoDB: Waiting for purge to start
2016-02-28T18:44:40.185456Z 0 [Note] InnoDB: Waiting for purge to start
2016-02-28T18:44:40.236970Z 0 [Note] InnoDB: Waiting for purge to start
2016-02-28T18:44:40.292644Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 0
2016-02-28T18:44:40.421142Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2016-02-28T18:44:40.642217Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2016-02-28T18:44:41.016703Z 0 [Note] Salting uuid generator variables, current_pid: 504, server_start_time: 1456685077, bytes_sent: 0,
2016-02-28T18:44:41.056673Z 0 [Note] Generated uuid: '539246ef-de4b-11e5-a535-b8ac6f65e9fe', server_start_time: 1456685581, bytes_sent: 3022329767296
2016-02-28T18:44:41.106807Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 539246ef-de4b-11e5-a535-b8ac6f65e9fe.
2016-02-28T18:44:41.496798Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-02-28T18:44:41.644892Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-02-28T18:44:41.697459Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2016-02-28T18:44:41.698960Z 0 [Note] IPv6 is available.
2016-02-28T18:44:41.698960Z 0 [Note] - '::' resolves to '::';
2016-02-28T18:44:41.699962Z 0 [Note] Server socket created on IP: '::'.
2016-02-28T18:44:41.703464Z 0 [Warning] Failed to open optimizer cost constant tables
2016-02-28T18:44:45.751401Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2016-02-28T18:44:45.787570Z 0 [ERROR] Aborting
2016-02-28T18:44:45.788067Z 0 [Note] Binlog end
2016-02-28T18:44:45.828191Z 0 [Note] Shutting down plugin 'ngram'
2016-02-28T18:44:45.828675Z 0 [Note] Shutting down plugin 'partition'
2016-02-28T18:44:45.829175Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-02-28T18:44:45.829676Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-02-28T18:44:45.830175Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-02-28T18:44:46.031497Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-02-28T18:44:46.031969Z 0 [Note] Shutting down plugin 'MyISAM'
2016-02-28T18:44:46.598005Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-02-28T18:44:46.598485Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-02-28T18:44:46.598988Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-02-28T18:44:46.599486Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-02-28T18:44:46.600036Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-02-28T18:44:46.600486Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-02-28T18:44:46.600986Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-02-28T18:44:46.601486Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-02-28T18:44:46.601988Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-02-28T18:44:46.602487Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-02-28T18:44:46.602487Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-02-28T18:44:46.602988Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-02-28T18:44:46.603489Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-02-28T18:44:46.603989Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-02-28T18:44:46.604490Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-02-28T18:44:46.604990Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-02-28T18:44:46.605490Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-02-28T18:44:46.605490Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-02-28T18:44:46.605990Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-02-28T18:44:46.606491Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-02-28T18:44:46.606991Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-02-28T18:44:46.607492Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-02-28T18:44:46.607992Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-02-28T18:44:46.608493Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-02-28T18:44:46.608493Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-02-28T18:44:46.608993Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-02-28T18:44:46.609535Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-02-28T18:44:46.610023Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-02-28T18:44:46.610511Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-02-28T18:44:46.610511Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-02-28T18:44:46.611026Z 0 [Note] Shutting down plugin 'InnoDB'
2016-02-28T18:44:46.611524Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-02-28T18:44:46.611996Z 0 [Note] InnoDB: Starting shutdown...
2016-02-28T18:44:46.721456Z 0 [Note] InnoDB: Dumping buffer pool(s) to D:\mysql\data\ib_buffer_pool
2016-02-28T18:44:46.729458Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160229 0:14:46
2016-02-28T18:44:48.212545Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1209970
2016-02-28T18:44:48.213546Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-02-28T18:44:48.214047Z 0 [Note] Shutting down plugin 'MEMORY'
2016-02-28T18:44:48.214047Z 0 [Note] Shutting down plugin 'CSV'
2016-02-28T18:44:48.214547Z 0 [Note] Shutting down plugin 'sha256_password'
2016-02-28T18:44:48.214547Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-02-28T18:44:48.215047Z 0 [Note] Shutting down plugin 'keyring_file'
2016-02-28T18:44:48.259518Z 0 [Note] Shutting down plugin 'binlog'
2016-02-28T18:44:48.260518Z 0 [Note] mysqld: Shutdown complete
At least one of the required tables does not exist as seen in the log file you presented: "Table 'mysql.user' doesn't exist." If you have not already "run mysql_upgrade to create it," then Perhaps manually initialize the data directory
You should run "mysqld --initialize" before server start.
https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html