I tried everything, changing the port no. and all but it still did not start I had to end the mysql process using the activity monitor and now the tables wont respond. When I click the name it shows an error message: #1146 table 'table_name' doesn't exist!
My past projects will be wasted if they don't respond and I had forgotten to export the databases.
you can run this command to repair any database you have:
mysqlcheck -u mysql_username -p database_name
but if you see this error after running this:
Error: Table 'database_name.table_name' doesn't exist
you should drop your damaged table, all details can you find through this link
Related
After I upgraded MySQL 5.7 to MySQL 8.0, I started MySQL again and I got an error:The user specified as a definer ('mysql.infoschema'#'localhost') does not exist' when trying to dump tablespaces.
I don't understand why this problem occurs. And I want to know how to solve it
I had the same error when I accidentally downgraded my MySQL version from 8 to 5.7. At the first start the older version broke something so that version 8 was showing the error above.
In my case I had to enter the docker container where MySQL was running first
docker exec -it mysql bash
Then I basically followed the steps here
mysql -u root -p
mysql> SET GLOBAL innodb_fast_shutdown = 1;
mysql_upgrade -u root -p
This took some minutes but then everything was working again.
It may occur after some time after you set up your new system.
As a suggested solution, just try on Windows
1) open cmd.exe as Administrator
2) run mysql_upgrade.exe -uyour_user_name -pyour_password
mysql_upgrade.exe can be located at
C:\Program Files\MySQL\MySQL Server 8.0\bin
Then run the following to see if the infoschema user has appeared.
select user, host from mysql.user;
In my case, such error was caused by that I had changed the host of the dba user from % to localhost to strengthen the security.
I used "abcdba" with DDL right to create db schema, and used "abc" with CURD right for the Web service to use the DB. After the change, the read operations were OK but the write operations failed with the error message in the OP.
Flush privilege or restarting the server did not solve the problem. Then I changed to host of the dba user back to %. Then things have become normal again.
Apparently mysql does not like the changes of host of the dba user, and existing databases created by that dba user will have problem if the host of the dba user is changed.
Essentially, changing the host of the dba user is actually removing user abcdba#% and creating a new user abcdba#localhost. Here had come the error message, since abcdba#% and abcdba#localhost are 2 differently fully qualified usernames.
I have downloaded mysql workbench on my mac to have a gui for my mysql installation.
I have set the connection to '127.0.0.1(localhost):3306' succesfully
I have created a new database with some table, all works well.
Now when i start mysql command line monitor from a terminal session:
/usr/local/mysql/bin/mysql
And ask for a 'show databases', i cant see the newly created database.
So i did: 1)a mysqladmin reload:nothing, 2)reboot the system: nothing.
How can i synch mysql command line monitor to see the new db?
When i check the 'server status'option on workbench all seems fine, i mean i see its pointing to localhost:3306 and all directories listed there are perfectly matching my local installation, i checked this because at one point i thought that i had 2 mysql installations.
/usr/local/mysql/bin/mysql -u<the same user as in workbench> -p
then authenticate with the same password you use in workbench.
Ok, so I had a very large (40GB) database containing 1 table. I went to the Windows MySQL command prompt and typed:
drop database very_large_db;
I waited a few minutes and it came back with an error. I'm sorry but I forgot to record the error number. It then tried to reconnect and was unable to re-connect to the MySQL command prompt. I then rebooted the computer, went back to the command prompt, and tried to drop the database again. At this point, it just kicked me out and the MySQL service stopped (verified in services.msc). Next, I decided to go to the MySQL data directory in Windows Explorer and manually delete the database directory. It deleted no problem, and when I perform a "show databases;" command in the MySQL command prompt, it is no longer there.
Is there anything else I need to do to make sure the database was properly deleted? Is there any chance I corrupted any other databases in MySQL?
Thanks
Deleting the directory is equivalent to DROP TABLE. Try this: create a sub-directory in data and run 'SHOW DATABASES;' you'll see that MySQL just considers the directory to be a database.
I connect my Rails app to MySQL database, working with that and after turning off the laptop and starting Rails and MySQL server again, I get the error
ActionView::Template::Error (Mysql2::Error: Table 'database.table' doesn't exist: SHOW FULL FIELDS FROM `table`):
This is in Rails log.
When I log in into MySQL through the terminal
mysql -u root -p
choose a database and then try to display data from a table, like
mysql> select * from users;
ERROR 1146 (42S02): Table 'database.users' doesn't exist
I google this issue and found a temporarily solution, but this is not appropriate because it involves remove all old data in the respective database:
cd /usr/local/mysql/data
sudo rm -rf database_name
So I would like to ask you for help - how to properly figure out this issue?
Thank you
Looks like you're using rails, did you issue the command
rake db:migrate
And while you're in mysql I suggest you to get the list of available tables with:
show tables;
The Problem
My MySQL database works fine for my web application. However, when I try to open the database with phpMyAdmin, I get this error message:
#2006 - MySQL server has gone away
And phpMyAdmin disconnects back to the login screen. Other databases work fine.
My ax_allowed_packet is set to 16. I also tried 64, but it didn't work.
Also this error occured eventually. The database is about 3 MB in size, so not very big.
Used Software
Debian Squeeze x64
MySQL (current version)
phpMyAdmin (current version)
Question
How can I fix this error in order to view and edit my database in phpMyAdmin again?
I finally found it.
Apparently, there were some incompatibility issues after upgrading to MySQL 5.6.
In order to check for such issues and fix them, you will need to do a MySQL Upgrade.
Just run the following on a terminal:
mysql_upgrade -u root -p
Enter your password, and wait until the upgrade finishes.
This fixed the problem for me.
My Reputation is not high enough so i can't comment so i will here, mysql_upgrade -u root -p worked for me i had the same issue, after upgrading mysql, everything worked. i could could log into the database using phpmyadmin but when i tried to add a user it failed , giving MySQL “#2006 - MySQL server has gone away”, Note that i also updated phpmyadmin with yum update phpmyadmin first before running mysql_upgrade -u root -p.
Now all works fine, thanks!