MySQL DB error in displaying table - mysql

I have a problem when I backup my database from old server to the new one. Both run Ubuntu. The difference is the old database is using phpmyadmin 1.6.3 and the new one is 5.7.21. I lost some tables but it appear in the sidebar. Can anyone describe to me what is going on with my db? Here is the screenshot.
to be clear, here is the screenshot of my old database phpmyadmin interface.

You may try stop and start the mysqld service.
If the error still exists then back up the database file and drop it then import again to a newly created database.
**commands may be OS specific
follow instructions from : MySQL Site

Related

xampp #1932 - Table 'phpmyadmin.pma__tracking' doesn't exist in engine

i tried to open my local Xampp to work on some projects, but when i go on Phpmyadmin and try to access to any database i retrieve the error message in the object.
I have to backup some db in every way because they are very important.
I tried to delete the pma_bookmark.frm and .ibd and then create again creates_table.sql but it doesn't solve my problem.
How can i solve this issue, but more, how can i save my databases and reload them on another installation or in another server ?

databases not visible in mysql workbench sidebar

It started with installation of wampserver for php, before that I had already running MySQL server 5.7 with all databases properly showing in the side schema panel. When I launched MySQL server after installation of wampserver 5.7.14, the password for root was overridden and no database except sys is showing. Also I found another user (mysql.sys) has been created (found in Users and Privileges). Then I looked for databases in path "ProgramData\MySQL\MySQL Server 5.7\Data", all databases are present in the folder (thank god they are not deleted). Problem is now for my website I get this error:
"Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration"
Exception Details: System.Data.Entity.Migrations.Infrastructure.AutomaticMigrationsDisabledException: Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration.
I know this is not related to migrations because my database already exists but I don't know how to solve the problem that MySQL can see the databases in its "ProgramData\MySQL\MySQL Server 5.7\Data" again.
When you installed WAMPServer on a system that already had a MYSQL Server instance installed on it, you created a second MySQL Server instance. See your service you will have one called wampmysqld or wampmysqld64 and another called MYSQL.
Now, whichever service you start first will be the MySQL Server that Workbench, or anything else is talking to. And you will only see the databases that this MySQL Server instance knows about.
Correct Solution:
Stop WAMPServer
Start the MYSQL installed with Workbench
Backup all YOUR databases, NOT the ones created by MySQL like mysql, sys, information_schema, performance_schema
Stop this MYSQL Server.
Uninstall this MySQL Server
Start WAMPServer
Restore your databases to this MySQL Server instance
All should start working as expected now.
Connect your Workbench to WAMPServers MySQL Server
Update
Did a robust workaround, though not very suggestible but database is now accessible in MySQL workbench. Though I'm having the same error when opening the website on local web server. One thing that I did not mention before that environment is Windows based. what I did is copied database from the ProgramData MySQL path to "..\wamp64\bin\mysql\mysql5.7.14\data" path and refreshed schema in workbench. Any advice why I'm still having problem in web server.

The mysqli error was: Unknown database

I am importing a mysql database from the webserver to my local system for a migration from drupal 6 to drupal 8.
I did an Export with phpmyadmin on the server. Then I created the database locally also with phpmyadmin and imported my dump from the server via phpmyadmin's import function.
Then I created the user with the setting of my drupal 6 configuration.
I can see the database in phpmyadmin if I connect with my local root user.
I cannot connect with the user created from the settings ( lets call that the drupal_db_user)
If I call the drupal site on my local apache ( apache & mysql server are running or my phpmyadmin would not work) I get the messeage from drupal:
"The mysqli error was: Unknown database 'my_drupal_db'."
Via Mysqlworkbench I am also not able to conntect to the my_drupal_db with the drupal_db_user.
I use locally php 5.6 and mysql 5.6 on a ubuntu system.
Creating the user and db via mysql console also did not help.
Any clue what might be wrong here? I suspect it could be the password encryption, but I have no clue how to check / change that other than trying the two options phpmyadmin (version 4.6) is offering me.
I guess you dont need to backup on your pc as the files that you exported from server is a backup on its own. Just download the sql file update to drupal 8 and finally import the file and you should have it installed.
Or simply try importing the exported file from server to another subdomain drupal 8 as a test. To check If it really works.
Found the problem.
after at least 3 hours poking around and cursing.....
When I created the database locally I had by mistake an whitespace in front of the db name.
Which by the way was possible... I didn't know you could even create databases with whitespaces in the name.
What let me find the error was this post:
https://drupal.stackexchange.com/questions/27050/fatal-error-pdoexception-sqlstate42000-1049-unknown-database
and the hint with this query:
SELECT * FROM my_drupal_db.users
which of course failed and made me really question the database name.
Hope that helps someone else saving 3 hours!

Mysql is not working correctly

Hello Stackoverflow,
I was trying to connect to my MySQL database through Coda 2. I connected, created a database called 'database1' (for example), then I tried to create a table called 'user', but I get this error:
MySQL said: Table 'user' is read only
I was surprised because it had worked previously with other databases long time ago. I went to my xampp files, //xampp/mysql/data/database1/ and then I found out that user.ibd is there alone. So I first tried to change the properties of the files by disabling read-only. The problem is that when I did that, close the properties windows, and opened again I would get the read-only check box on. So I gave up on that. So I said ok, I will just create the database from my server instead. So I when to phpmyadmin, I see that database1 is created but there is no table called 'user'. So I try to create a table and I get this error:
#1813 - Tablespace for table '`database1`.`user`' exists. Please DISCARD the tablespace before IMPORT.
I then I found out I cannot even do much with phpmyadmin from my server. I tried reinstalling xampp, but it was impossible for me to remove the origianal because it was "already" in use. Please help me and thank you!
EDIT: I can apparently create databases but not tables. Just to clear that up.
You can try using CLI and logged into mysql and create a new database and a table. If it's working, there's something wrong with your phpmyadmin not mysql. Make sure you logged in as the same user (whom have root privileges) when creating the database and table.

Mysql Table corrupted after restarting PC

I am working on Symfony2 Project and am beginner in symfony Framework. I am using XAMPP as webserver. Everything is working properly until system restarts. When I restart my computer the tables of mysql database using by symfony project corrupts automatically.
I am using windows 7 professional 32bit OS.so, is there any problem in mysql?
MySQL tables can become corrupt for several reasons, such as hardware
failure, operating system bugs, viruses and bugs in MySQL. hMailServer
itself does not cause corrupt MySQL tables. hMailServer communicates
with MySQL over TCP/IP using a standardized language.
There's nothing in this language that can cause corrupt tables.
If a MySQL table becomes corrupt, you need to repair it. Note that repairing a corrupt MySQL table may lead to loss of data. It's therefore important to create a backup of your system.
How do you know whether a table is corrupt?
Examine the hMailServer error log. If you see a lot of Error while executing SQL statement-messages, then it's likely that one or more of your tables are corrupt. Feel free to ask in the forum if you're unsure.
Step 1: Determine MySQL password
If you are using an external version of MySQL, you should already know your MySQL password.
If you are using the built-in MySQL version that comes with hMailServer, you might not know your password. To determine it, follow these steps:
Run the script hMailServer/Addons/Utilities/DecryptBlowfish.vbs.
Enter your main hMailServer Administrator password. This is the
password you specified during the installation when you first
installed hMailServer. Click OK.
Open up hMailserver.ini, located in your Windows directory or
hMailServer bin directory.
Copy the database password from hMailServer.ini to the "Enter
encrypted password" dialog. In hMailServer.ini, you should see a
line looking like this: [Database]
...
password=c85dae3cb73394ab
In this example, c85dae3cb73394ab is the encrypted password.
Click OK in DecryptBlowfish to view your password
DecryptBlowfish will now show your password. Either keep the dialog open or memorize the password.
Step 2: Connect to the server
To be able to repair your table, you need to connect to the MySQL server using a MySQL client. You can use SQLyog for this.
Download and install SQLyog
Create a new connection.
Enter the connection information for your MySQL server. If you are
using the built-in server, you should enter hostname: localhost,
user:root, password:password from DecryptBlowfish, port:3307
Click Connect to connect to the database server
Step 3: Repair the table
Follow these steps to run the SQL statement to repair the table.
In the tree to the left, click on the hmailserver database.
The hMailServer database will now be active.
In the right part of the SQLyog window, click on the Query tab.
Enter REPAIR TABLE tablename, for example, REPAIR TABLE hm_messages.
Click on the Execute Current Query button in the toolbar (or select
Edit->Execute Query->Execute current query or press F5).
MySQL should now repair the table. After the table has been repaired, restart the MySQL and than the hMailServer service. Depending on what table is corrupt, a restart of the services may not be required, but we recommend that you always do it.
Source