ERROR 1049 (42000): Unknown database 'test' - mysql

I am trying to install mySQL server on CentOS6.6 without root access.
Here are my steps.
Unpack mysql-8.0.11-linux-glibc2.12-i686 in a directory(EX:[Base MySQL Directory])
Initialize and generate root password:
./mysqld --initialize --user=mysql --lc_messages_dir=[Base MySQL Directory]/share --basedir=[Base MySQL Directory] --datadir=[BaseMySQL Directory]/data --log-error=[Base MySQL Directory]/data/mysql.err --pid-file=[Base MySQL Directory]/mysql.pid --socket=[Base MySQL Directory]/thesock --port=3306 &
Start the server:
./mysqld --user=mysql --basedir=[Base MySQL Directory] --lc_messages_dir=[Base MySQL Directory]/share --datadir=[Base MySQL Directory]/data --log-error=[Base MySQL Directory]/data/mysql.err --pid-file=[Base MySQL Directory]/mysql.pid --socket=[Base MySQL Directory]/thesock --port=3306 &
Access MySQL database:
./mysql --socket=$MYSQL_TED_HOME/thesock --user=root --password="IL-Rp=Wj*3dg"
But I got an Error message:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database 'test'
I know there are already tons of questions like "ERROR 1049 (42000): Unknown database....
". But I couldn't find any of them is similar to mine.
Here is "mysql.err":
[Warning] Changed limits: max_open_files: 1024 (requested 5000)
[Warning] Changed limits: table_open_cache: 431 (requested 2000)
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[Warning] One can only use the --user switch if running as root
[Warning] InnoDB: New log files created, LSN=45790
[Warning] InnoDB: Creating foreign key constraint system tables.
[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: ec2d7935-43d0-11e8-96ee-d89d6726c984.
[Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
[Note] A temporary password is generated for root#localhost: IL-Rp=Wj*3dg
[Warning] Changed limits: max_open_files: 1024 (requested 5000)
[Warning] Changed limits: table_open_cache: 431 (requested 2000)
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[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.
[Note] ./mysqld (mysqld 5.7.13) starting as process 6390 ...
[Warning] One can only use the --user switch if running as root
[Note] InnoDB: PUNCH HOLE support not available
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Uses event mutexes
[Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
[Note] InnoDB: Compressed tables use zlib 1.2.3
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Number of pools: 1
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: Creating shared tablespace for temporary tables
[Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
[Note] InnoDB: File './ibtmp1' size is now 12 MB.
[Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
[Note] InnoDB: 32 non-redo rollback segment(s) are active.
[Note] InnoDB: Waiting for purge to start
[Note] InnoDB: 5.7.13 started; log sequence number 2524437
[Note] InnoDB: Loading buffer pool(s) from [Base MySQL Directory]/mysql-5.7.13-linux-glibc2.5-x86_64/data/ib_buffer_pool
[Note] Plugin 'FEDERATED' is disabled.
[Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
[Note] Server hostname (bind-address): '*'; port: 3306
[Note] IPv6 is available.
[Note] - '::' resolves to '::';
[Note] Server socket created on IP: '::'.
[Note] InnoDB: Buffer pool(s) load completed at 180419 20:55:57
[Note] Event Scheduler: Loaded 0 events
[Note] ./mysqld: ready for connections.
Version: '5.7.13' socket: '[Base MySQL Directory]/thesock' port: 3306 MySQL Community Server (GPL)

Related

MySQL docker: Import schema file with error: inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt'

I am working with MySQL docker image version 5.7 with initialize the data by the schema file but got some error can't solve.
My docker command line is:
docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
and get the error, the log as below:
$ docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Initializing database files
2021-03-17T02:05:15.606058Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:15.756090Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-03-17T02:05:15.779384Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-03-17T02:05:15.837663Z 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: 373d4ffb-86c5-11eb-8780-0242ac110002.
2021-03-17T02:05:15.839186Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-03-17T02:05:16.450734Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:16.576740Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Database files initialized
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Starting temporary server
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Waiting for server startup
2021-03-17T02:05:18.819727Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:18.820623Z 0 [Note] mysqld (mysqld 5.7.33) starting as process 78 ...
2021-03-17T02:05:18.822725Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-03-17T02:05:18.822772Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-03-17T02:05:18.822783Z 0 [Note] InnoDB: Uses event mutexes
2021-03-17T02:05:18.822789Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-03-17T02:05:18.822795Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-03-17T02:05:18.822800Z 0 [Note] InnoDB: Using Linux native AIO
2021-03-17T02:05:18.823072Z 0 [Note] InnoDB: Number of pools: 1
2021-03-17T02:05:18.823301Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-03-17T02:05:18.824551Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-03-17T02:05:18.829149Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-17T02:05:18.830692Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-03-17T02:05:18.841912Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-03-17T02:05:18.846985Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-03-17T02:05:18.847098Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-03-17T02:05:18.862891Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-03-17T02:05:18.863475Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2021-03-17T02:05:18.863521Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2021-03-17T02:05:18.863960Z 0 [Note] InnoDB: Waiting for purge to start
2021-03-17T02:05:18.914486Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 2746831
2021-03-17T02:05:18.915203Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-03-17T02:05:18.915523Z 0 [Note] Plugin 'FEDERATED' is disabled.
2021-03-17T02:05:18.916967Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210317 2:05:18
2021-03-17T02:05:18.920098Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2021-03-17T02:05:18.920168Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2021-03-17T02:05:18.920570Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:18.920635Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2021-03-17T02:05:18.922497Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-03-17T02:05:18.926990Z 0 [Note] Event Scheduler: Loaded 0 events
2021-03-17T02:05:18.927219Z 0 [Note] mysqld: ready for connections.
Version: '5.7.33' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2021-03-17 02:05:19+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2021-03-17 02:05:20+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/IRMSDB_2021-03-09.sql
ERROR 1064 (42000) at line 287: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt' at line 5
I checked my schema file and no idea what the error exactly and no idea how to fix it.
My schema file is exported from Sequel Pro.
Could you kindly provide some idea to solve the problem?
Thanks very much.
Just attached my schema file below, and please change the extension name from jpg to SQL.
Click here to download: MySQL schema file

InnoDB: Header page consists of zero bytes in datafile: ./ibdata1

I am deploying MySQL on openshift (kubernetes) but getting below error
---> 10:01:34 Initializing database ...
---> 10:01:34 Running /opt/rh/rh-mysql57/root/usr/libexec/mysqld --initialize --datadir=/var/lib/mysql/data --ignore-db-dir=lost+found
---> 10:01:35 Starting MySQL server with disabled networking ...
---> 10:01:35 Waiting for MySQL to start ...
2019-10-18T10:01:35.188509Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-10-18T10:01:35.188567Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2019-10-18T10:01:35.325995Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld (mysqld 5.7.24) starting as process 40 ...
2019-10-18T10:01:35.430574Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-10-18T10:01:35.430612Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-10-18T10:01:35.430621Z 0 [Note] InnoDB: Uses event mutexes
2019-10-18T10:01:35.430627Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-10-18T10:01:35.430634Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2019-10-18T10:01:35.430642Z 0 [Note] InnoDB: Using Linux native AIO
2019-10-18T10:01:35.431024Z 0 [Note] InnoDB: Number of pools: 1
2019-10-18T10:01:35.431174Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-10-18T10:01:35.433296Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 8, chunk size = 128M
2019-10-18T10:01:35.584269Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-10-18T10:01:35.610249Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-10-18T10:01:35.624480Z 0 [ERROR] InnoDB: Header page consists of zero bytes in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2019-10-18T10:01:35.624518Z 0 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2019-10-18T10:01:35.624667Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
---> 10:01:36 Waiting for MySQL to start ...
2019-10-18T10:01:36.225356Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-10-18T10:01:36.225372Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-10-18T10:01:36.225377Z 0 [ERROR] Failed to initialize builtin plugins.
2019-10-18T10:01:36.225380Z 0 [ERROR] Aborting
2019-10-18T10:01:36.225393Z 0 [Note] Binlog end
2019-10-18T10:01:36.225454Z 0 [Note] Shutting down plugin 'CSV'
2019-10-18T10:01:36.233760Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld: Shutdown complete
I searched on google and they recommend to do following
rm -rf /var/lib/mysql/ib_logfile*
but as you know in docker and kubernetes world as soon as pod is not able to come up we cant login to pod and delete these files. Due to this error MySQL pod is not coming up.
I am using glusterfs and i deleted PVC and recreated but still same error.
Update1:
After recommendation of #Crou i did following changes
I downloaded new "centos/mysql-57-centos7:5.7" image and retry still same issue
I used mysql:5.7 image and now its throwing following error
I deleted PVC and recreated with different size but still same error.
[ERROR] --initialize specified but the data directory has files in it. Aborting.
[ERROR] Aborting
It seems to me that your image is broken, or at least the data you are trying to load.
Even if you do remove the files /var/lib/mysql/ib_logfile* this will break again when pod will be rescheduled.
You can try getting into the pod using kubectl exec -it <pod_name> bash when it is still starting and quickly do the changes. If it's already too late and it just fails within few seconds with crashloopbackoff, you might try fixing this in the dockerfile that is being used to crate the image. If you have no access to the dockerfile, you can create your own dockerfile and build image based on it.
Here is a documentation with Dockerfile reference that might be helpful.
Dockerfile include something like this:
FROM oraclelinux:7-slim
RUN rm -rf /var/lib/mysql/ib_logfile*
EXPOSE 3306 6606 6446 6447 33060
CMD [""]
Please keep in mind this is just a short example and might not work on it self.
I was able to find this github mattlord/Docker-InnoDB-Cluster, maybe it will be of help.
After different retries i am able to solve issues, Following are findings
I observed that when first time i recreate PVC and deploy mysql it take too much time at this line
Running /opt/rh/rh-mysql57/root/usr/libexec/mysqld --initialize --datadir=/var/lib/mysql/data --ignore-db-dir=lost+found
During this time LiveProbe time exaust and it restart the container, which result in subjected error.
I increased the time of initialDelaySeconds under livenessProbe to 240, this time it started mysql after 4 mins
After 4 minutes it shows Starting MySQL server with disabled networking and start doing further.
My applications are able to connect it but i dont know what would be the impact of this?
---> 16:18:24 Running /opt/rh/rh-mysql57/root/usr/libexec/mysqld --initialize --datadir=/var/lib/mysql/data --ignore-db-dir=lost+found
---> 16:22:15 Starting MySQL server with disabled networking ...
---> 16:22:15 Waiting for MySQL to start ...
2019-10-18T16:22:15.752499Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-10-18T16:22:15.772646Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld (mysqld 5.7.24) starting as process 69 ...
2019-10-18T16:22:15.849580Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-10-18T16:22:15.849613Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-10-18T16:22:15.849617Z 0 [Note] InnoDB: Uses event mutexes
2019-10-18T16:22:15.849621Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-10-18T16:22:15.849624Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2019-10-18T16:22:15.849629Z 0 [Note] InnoDB: Using Linux native AIO
2019-10-18T16:22:15.850236Z 0 [Note] InnoDB: Number of pools: 1
2019-10-18T16:22:15.850459Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-10-18T16:22:15.852211Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 8, chunk size = 128M
2019-10-18T16:22:15.978704Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-10-18T16:22:16.005183Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-10-18T16:22:16.208237Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-10-18T16:22:16.402086Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-10-18T16:22:16.414708Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
---> 16:22:17 Waiting for MySQL to start ...
---> 16:22:18 Waiting for MySQL to start ...
2019-10-18T16:22:18.601639Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-10-18T16:22:18.608922Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2019-10-18T16:22:18.608943Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2019-10-18T16:22:18.609240Z 0 [Note] InnoDB: Waiting for purge to start
2019-10-18T16:22:18.659387Z 0 [Note] InnoDB: 5.7.24 started; log sequence number 2592555
2019-10-18T16:22:18.659667Z 0 [Note] Plugin 'FEDERATED' is disabled.
2019-10-18T16:22:18.663687Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/data/ib_buffer_pool
2019-10-18T16:22:18.808093Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2019-10-18T16:22:18.808117Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2019-10-18T16:22:18.825225Z 0 [Warning] CA certificate ca.pem is self signed.
2019-10-18T16:22:18.828435Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2019-10-18T16:22:18.885079Z 0 [Note] InnoDB: Buffer pool(s) load completed at 191018 16:22:18
2019-10-18T16:22:18.948358Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948397Z 0 [Warning] 'user' entry 'mysql.session#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948404Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948428Z 0 [Warning] 'db' entry 'performance_schema mysql.session#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948435Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948448Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:19.034170Z 0 [Warning] 'tables_priv' entry 'user mysql.session#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:19.034191Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:19.633088Z 0 [Note] Event Scheduler: Loaded 0 events
2019-10-18T16:22:19.633217Z 1 [Note] Event Scheduler: scheduler thread started with id 1
2019-10-18T16:22:19.633316Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld: ready for connections.
Version: '5.7.24' socket: '/tmp/mysql.sock' port: 0 MySQL Community Server (GPL)
2019-10-18T16:22:19.634316Z 3 [Note] Your password has expired. To log in you must change it using a client that supports expired passwords.
---> 16:22:19 MySQL started successfully
---> 16:22:19 Setting password for MySQL root user ...

Unable to start MySQL Server 'has length mismatch in the column name table_name'

I'm trying to run the MySQL Server after importing a big database file 32 GB length mismatch in the column name
MySQL 5.7 using rh-mysql57
After using the command to run the server I'm getting a success message saying
/etc/init.d/rh-mysql57-mysqld restart
Stopping rh-mysql57-mysqld: [ OK ]
Starting rh-mysql57-mysqld: [ OK ]
The i want to loggin to the mysql using mysql with/without password
i'm getting this error
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
This is the error.log
2019-06-19T13:24:05.489656Z mysqld_safe Starting mysqld daemon with databases from /var/opt/rh/rh-mysql57/lib/mysql
2019-06-19T13:24:05.751511Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld (mysqld 5.7.24-log) starting as process 19830 ...
2019-06-19T13:24:05.816168Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-06-19T13:24:05.816207Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-06-19T13:24:05.816225Z 0 [Note] InnoDB: Uses event mutexes
2019-06-19T13:24:05.816240Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2019-06-19T13:24:05.816254Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-06-19T13:24:05.816268Z 0 [Note] InnoDB: Using Linux native AIO
2019-06-19T13:24:05.818025Z 0 [Note] InnoDB: Number of pools: 1
2019-06-19T13:24:05.818276Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2019-06-19T13:24:05.821067Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 8, chunk size = 128M
2019-06-19T13:24:06.062258Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-06-19T13:24:06.095072Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-06-19T13:24:06.107846Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-06-19T13:24:06.275233Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-06-19T13:24:06.275514Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-06-19T13:24:06.360584Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-06-19T13:24:06.362431Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2019-06-19T13:24:06.362460Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2019-06-19T13:24:06.364052Z 0 [Note] InnoDB: 5.7.24 started; log sequence number 322424549252
2019-06-19T13:24:06.364899Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/opt/rh/rh-mysql57/lib/mysql/ib_buffer_pool
2019-06-19T13:24:06.365282Z 0 [Note] Plugin 'FEDERATED' is disabled.
2019-06-19T13:24:06.366882Z 0 [Note] InnoDB: Buffer pool(s) load completed at 190619 15:24:06
2019-06-19T13:24:06.381320Z 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2019-06-19T13:24:06.381431Z 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2019-06-19T13:24:06.387318Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2019-06-19T13:24:06.387370Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2019-06-19T13:24:06.398153Z 0 [Warning] CA certificate ca.pem is self signed.
2019-06-19T13:24:06.398250Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2019-06-19T13:24:06.399654Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2019-06-19T13:24:06.424466Z 0 [Note] IPv6 is not available.
2019-06-19T13:24:06.424509Z 0 [Note] - '0.0.0.0' resolves to '0.0.0.0';
2019-06-19T13:24:06.424554Z 0 [Note] Server socket created on IP: '0.0.0.0'.
2019-06-19T13:24:06.436535Z 0 [Note] Failed to start slave threads for channel ''
2019-06-19T13:24:06.449394Z 0 [Note] Event Scheduler: Loaded 0 events
2019-06-19T13:24:06.449666Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld: ready for connections.
Version: '5.7.24-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2019-06-19T13:24:07.101293Z 2 [Note] Access denied for user 'UNKNOWN_MYSQL_USER'#'localhost' (using password: NO)
2019-06-19T13:24:36.051422Z 3 [Note] Access denied for user 'root'#'localhost' (using password: YES)
The problem as I understand is coming from here
2019-06-19T13:24:06.381320Z 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2019-06-19T13:24:06.381431Z 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade
I've tried to run mysql_upgrade and the result is
mysql_upgrade: Got error: 1045: Access denied for user 'root'#'localhost' (using password: YES) while connecting to the MySQL server
Upgrade process encountered an error and will not continue
The problem was due to an import conflict between MySQL tables from the production server and test server.
As the file was large so difficult to modify the contents of the SQL file.
So the mysql database was imported too.
CAUTION BEFORE PROCESSING PLEASE BACKUP YOUR DATABASE!
The solution that worked for us is like the rest
1- Stop the mysql server
ref: https://dev.mysql.com/doc/refman/5.7/en/using-systemd.html
2-Added the following parameters to
/etc/my.cnf
ref: https://dev.mysql.com/doc/refman/5.7/en/system-schema.html
innodb_force_recovery = 1
skip-grant-tables
3- In the database directory, save the folder mysql copy themysql folder and empty the contents
4- Then execute the command
bin\mysqld --initialize
ref:
https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html
5- At the end execute the command
bin\mysql_upgrade
ref: https://dev.mysql.com/doc/refman/5.7/en/mysql-upgrade.html
6- Start the mysql server again
ref: https://dev.mysql.com/doc/refman/5.7/en/using-systemd.html
I got the same issue & error while working with docker.
docker exec -it container_name bash -c "mysql_upgrade -uroot -proot"
source: Running mysql_upgrade in Docker?

mysqldump got errors, Lost connection to MySQL server during query

When i am use mysqldump -uroot -p xxx > xxx.sql, i got some errors, 'mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table GAMES at row: 20826'.
Then i checked the mysql error logs, i found the errors below. I search lots of sites in google but got nothing.
Anyone who can help me with this, thank you!
2018-07-31 00:21:04 0x7fb3cc0ab700 InnoDB: Assertion failure in thread 140410199127808 in file btr0pcur.cc line 452
InnoDB: Failing assertion: page_is_comp(next_page) == page_is_comp(page)
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
16:21:04 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 76387 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7fb3a4012330
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fb3cc0aae70 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x3b)[0xe907ab]
/usr/sbin/mysqld(handle_fatal_signal+0x489)[0x789b49]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fb3e79ca390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fb3e6d83428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fb3e6d8502a]
/usr/sbin/mysqld[0x75f3e0]
/usr/sbin/mysqld(_Z26btr_pcur_move_to_next_pageP10btr_pcur_tP5mtr_t+0x1c8)[0x114e6f8]
/usr/sbin/mysqld[0x75cfbf]
/usr/sbin/mysqld(_Z15row_search_mvccPh15page_cur_mode_tP14row_prebuilt_tmm+0x11e5)[0x1099745]
/usr/sbin/mysqld(_ZN11ha_innobase13general_fetchEPhjj+0x6a)[0xf87a7a]
/usr/sbin/mysqld(_ZN7handler11ha_rnd_nextEPh+0xfc)[0x7d961c]
/usr/sbin/mysqld(_Z13rr_sequentialP11READ_RECORD+0x35)[0xbb3445]
/usr/sbin/mysqld(_Z10sub_selectP4JOINP7QEP_TABb+0x13e)[0xc23ffe]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x3c8)[0xc1cd18]
/usr/sbin/mysqld(_Z12handle_queryP3THDP3LEXP12Query_resultyy+0x233)[0xc8e753]
/usr/sbin/mysqld[0x7533a8]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THDb+0x492e)[0xc506ee]
/usr/sbin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x3ad)[0xc52b3d]
/usr/sbin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0x102a)[0xc53c7a]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x1c7)[0xc55137]
/usr/sbin/mysqld(handle_connection+0x288)[0xd16788]
/usr/sbin/mysqld(pfs_spawn_thread+0x1b4)[0xec9294]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb3e79c06ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fb3e6e5541d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fb3a404ae60): is an invalid pointer
Connection ID (thread ID): 4
Status: NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2018-07-30T16:21:04.660409Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-07-30T16:21:04.660458Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-07-30T16:21:04.840982Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-07-30T16:21:04.842849Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.22-0ubuntu0.16.04.1) starting as process 26568 ...
2018-07-30T16:21:04.847280Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-07-30T16:21:04.847312Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-07-30T16:21:04.847319Z 0 [Note] InnoDB: Uses event mutexes
2018-07-30T16:21:04.847324Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-07-30T16:21:04.847331Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-07-30T16:21:04.847336Z 0 [Note] InnoDB: Using Linux native AIO
2018-07-30T16:21:04.847618Z 0 [Note] InnoDB: Number of pools: 1
2018-07-30T16:21:04.847762Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-07-30T16:21:04.849397Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-07-30T16:21:04.857825Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-07-30T16:21:04.860275Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-07-30T16:21:04.872370Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-07-30T16:21:04.892980Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 5386460686
2018-07-30T16:21:04.893001Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 5386460695
2018-07-30T16:21:04.893008Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-07-30T16:21:04.893013Z 0 [Note] InnoDB: Starting crash recovery.
2018-07-30T16:21:05.008438Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-07-30T16:21:05.008468Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-07-30T16:21:05.008507Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-07-30T16:21:05.103402Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-07-30T16:21:05.104128Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-07-30T16:21:05.104147Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-07-30T16:21:05.105002Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 5386460695
2018-07-30T16:21:05.105371Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-07-30T16:21:05.106533Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-07-30T16:21:05.112425Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-07-30T16:21:05.112600Z 0 [Warning] CA certificate ca.pem is self signed.
2018-07-30T16:21:05.114984Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-07-30T16:21:05.115009Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2018-07-30T16:21:05.115029Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-07-30T16:21:05.121314Z 0 [Note] Event Scheduler: Loaded 0 events
2018-07-30T16:21:05.122659Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180731 0:21:05
2018-07-30T16:21:05.122807Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.22-0ubuntu0.16.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
2018-07-30T16:21:05.661985Z 2 [Note] Access denied for user 'root'#'localhost' (using password: NO)
Suggestions to consider for your my.cnf or my.ini [mysqld] section
SELECT ##thread_cache_size; # will give you current setting
SELECT ##innodb_buffer_pool_size; # will give you current setting
Multiply each by 1.3 and set with
SET GLOBAL thread_cache_size=<calculated-size>; # use rounded UP whole numbers
SET GLOBAL innodb_buffer_pool_size=<calculated-size>;
or if you have an OLD VERSION of MySQL, you must change in your
my.cnf or my.ini, shutdown/restart.
Let us know how it goes, please.
For additional assistance, view profile, Network Profile, for contact info including Skype ID. Thanks

PHPMyadmin Error: #2002 - No such file or directory<br />The server is not responding

I have phpMyAdmin installed on Ubuntu 16.04 Lamp Server on an Oracle VM. When I try to enter phpMyAdmin via http://localhost/phpmyadmin, I receive the following error:
Error: #2002 - No such file or directoryThe server is not responding
After reading previous threads, I have tried to unsuccessfully reinstall mysql-server to no avail. The MySQL error log in /var/log/... contains the following:
2017-01-22T16:18:06.214161Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-01-22T16:18:06.214326Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-01-22T16:18:06.536519Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-22T16:18:06.543467Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17-0ubuntu0.16.04.1) starting as process 3647 ...
2017-01-22T16:18:06.571026Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-01-22T16:18:06.571095Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-01-22T16:18:06.571106Z 0 [Note] InnoDB: Uses event mutexes
2017-01-22T16:18:06.571120Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-01-22T16:18:06.571130Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-01-22T16:18:06.571139Z 0 [Note] InnoDB: Using Linux native AIO
2017-01-22T16:18:06.571731Z 0 [Note] InnoDB: Number of pools: 1
2017-01-22T16:18:06.571975Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-01-22T16:18:06.577202Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-01-22T16:18:06.625715Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-01-22T16:18:06.631873Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-01-22T16:18:06.647876Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-01-22T16:18:06.736500Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-01-22T16:18:06.736633Z 0 [Note] InnoDB: Setting file \'./ibtmp1\' size to 12 MB. Physically writing the file full; Please wait ...
2017-01-22T16:18:07.143892Z 0 [Note] InnoDB: File \'./ibtmp1\' size is now 12 MB.
2017-01-22T16:18:07.145163Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-01-22T16:18:07.145188Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-01-22T16:18:07.150769Z 0 [Note] InnoDB: Waiting for purge to start
2017-01-22T16:18:07.201406Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 16765716
2017-01-22T16:18:07.207484Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-01-22T16:18:07.208190Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170122 17:18:07
2017-01-22T16:18:07.208412Z 0 [Note] Plugin \'FEDERATED\' is disabled.
2017-01-22T16:18:07.229256Z 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-01-22T16:18:07.229286Z 0 [Note] Server hostname (bind-address): \'127.0.0.1\'; port: 3306
2017-01-22T16:18:07.229302Z 0 [Note] - \'127.0.0.1\' resolves to \'127.0.0.1\';
2017-01-22T16:18:07.229351Z 0 [Note] Server socket created on IP: \'127.0.0.1\'.
2017-01-22T16:18:07.230207Z 0 [ERROR] Fatal error: Can\'t open and lock privilege tables: Incorrect file format \'user\'
2017-01-22T16:18:07.230287Z 0 [ERROR] Aborting
');
I have tried to apply various solutions including this - MySQL Fatal error: Can't open and lock privilege tables: Incorrect file format 'user'
Unfortunately, I am not able to access Mysql and therefore unable to follow the solution. $ sudo mysqld --skip-grant-tables does not allow me to access it.