Migrating Wordpress database to server SQL error - mysql

I have just finished a Wordpress site and I'm trying to set it up on the server. I did the following, as always:
uploaded a .htaccess file to a public_html folder with the text from https://codex.wordpress.org/htaccess (basic WP)
moved all the contents from the local wordpress folder to public_html
exported my local database and changed all instances of 'localhost/siteName/wordpress' with 'www.siteAddress.com'
created a mySQL database in cPanel's mySQL section
created a new user in cPanel's mySQL section
changed the wp_config file so that db_name, db_user and db_password values mach the prefix_name, prefix_username and user password of the newly created db/user
added that user to the database with all privileges granted
TRIED to import the exported local database to server via cPanel's phpMyadmin section. That's where I got this error:
1044 - Access denied for user 'something'#'localhost' to database 'else'
Of course, 'something' and 'else' are not the real values... Can anyone tell me if I did something wrong, or I didn't do something else at all? I never had this problem before? The differences are that the Wordpress itself got updated in the meantime and I worked with WooCommerce for the first time... if it matters, though I suspect it doesn't.
Thanks in advance, I know it's a bit of reading :)
[EDIT]: I tried the same procedure again (third time in a row), and it worked... so, the solution would be - the question itself.

Take a look at this dzenesiz and see if this helps.
http://www.inmotionhosting.com/support/website/database-troubleshooting/mysql-1044-access-denied-error-message

Related

Can't select database error in WordPress localhost on WAMP Server

I’m following this Lynda.com tutorial (WordPress – Building Themes from Scratch Using Underscores (2017)) and haven’t gotten very far. I’ve installed a blank WordPress install on localhost using WAMP Server and I downloaded and installed the underscores theme. But for some reason when I am trying to launch the website I am getting this error:
Can’t select database
We were able to connect to the database server (which means your username and password is okay) but not able to select the lynda_under17_040518 database.
Are you sure it exists?
Does the user root have permission to use the lynda_under17_040518 database?
On some systems the name of your database is prefixed with your username, so it would be like username_lynda_under17_040518. Could that be the problem?
If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.
Here is what i know
The database exists and I can run SQL commands on it in phpMyAdmin.
My user is root
Host is localhost
Database is lynda_under17_040518
root has all privileges to database (as verified in phpMyAdmin)
Other local websites on the same WAMPServer work just fine
This Stack Overflow post says to put define( 'WP_DEBUG_LOG', true ); in wp-config.php which I’ve done. It also says:
“the debug.log file will be in wp-content.”
I don't see any debug log even though I’ve restarted all services in WAMP and refreshed the browser.
Other Links I Consulted
I reviewed the info on these pages, but they didn't really help for my situation.
can't select database wordpress error
Can't select database - Wordpress
https://acloud.guru/forums/aws-certified-solutions-architect-associate/discussion/-KP4_87InltfL9P6rf-J/cant-select-database-wordpress-error
https://chartio.com/resources/tutorials/how-to-grant-all-privileges-on-a-database-in-mysql/
https://serverfault.com/questions/263868/how-to-know-all-the-users-that-can-access-a-database-mysql/263936
Where is my debug log and how can i get my local website running?
Even though SQL and its ilk will allow database names that are very long, a lot of applications (such as cPanel) will only recognize database names that are 16 characters or less. I suspect that your database name (lynda_under17_040518) is simply too long for WAMP and/or WordPress to recognize and will work correctly if the database name is shortened.
In my case, I was using an alternate port (something other than 3306), so I had to follow these instructions:
https://codex.wordpress.org/sk:Editing_wp-config.php#MySQL_Alternate_Port

Jawsdb on heroku, new database post migration, (Mysql2::Error: INSERT command denied to user..?)

Deployed a new version of our app on heroku and migrated over database from previous free jawsdb instance. However now every time user signs up gives
(Mysql2::Error: INSERT command denied to user <username for instance
what have i missed
migrated using a dump and re-import using mysql command line. eye balled exported data and it seems to be there (user emails etc)
all config vars look ok (DATABASE_URL is mysql2...)
i can login to the database via the url
I have not had to grant access or anything like that before, anyone come across this?
thanks
Ben
My guess is they disabled your INSERT grant because you have reached your max Storage Capacity for your plan.
To validate this is a permissions problem, log into a MySQL prompt with the user the app is running as, and enter this query:
SHOW GRANTS;
It probably list many, but no INSERT.
See this link. As explained in given link, jawsdb preliminary plan does not give you permission to add a new database. You are provided with one schema with some random name and you have to work with that only.
Check your migration
e.g. Make sure the database name matches.
For me, I got the same error as OP when trying to migrate my data. This was a fresh account with only a 50kb'ish database; nowhere close to the free-plan 5mb limit.
In my SQL export statement, my local database name is being used, however the remote MySQL (ie JawsDB) service auto-generates a db name, which will obviously not be the same. Simply used find-replace to change the database name to match remote; everything works.

Issue with connecting to database on Wordpress

I am trying to get Wordpress up and running but I get the "Error establishing a database connection" page pop up.
Here is the setup and what I've done:
I have a server running Wordpress fine. I took a snapshot from the AWS volume that had the wp-config.php information from the running server and spawned a new server with a volume that is snapshotted. I've checked all my settings and it all looks fine.
On the SQL sever side (MYSQL), I added the new IP with all the correct username/passwords so the database server will allow it to connect. I also have put print statements while wordpress tries to load the database. The values returned are all correct. Based on some threads I read, I also deleted my wp-config file and re-copied it from the original server.
I also made sure the permissions are correct. Any other suggestions on what I could be missing?
I was able to fix this. The issue had nothing to do with Wordpress or the server, but with MYSQL. The database have Schema privileges and I hadn't set it for my new IP address. Adding the privileges fixed the issue.

MySQL 403 forbidden error

I'm attempting to delete certain data from a table and this is what happens...
Error in processing the request.
I have no idea about what may be the cause.
I've reuploaded the whole phpmyadmin .zip to my site
I've created a clone database and added the same user to it
I've added all privileges to the user that manages the database
I've created a new user with all privileges to manage the database
None worked... The strange thing is that when I access the database from Cpanel I can do everything normally, this issue only happens when I access from my site.
Image with error:

Easy PHP and mysql ..php cannot see database on local pc (all works on server)

I have a website written in php and mysql (written by someone else) and I need to alter it- just for your interest it is bridgetjonesart.co.uk. So I thought I would download it to my desktop pc and use easy php and mysql locally to make changes then upload it again.
I seem to have downloaded everything okay. I first just tried to run existing php using Easy Php and got
Warning: mysql_connect(): Access denied for user 'runningc'#'localhost' (using password: YES) in C:\Program Files (x86)\EasyPHP-12.1\www\backup from runningc\public_html\bridgetjonesart.co.uk\mysqlLogin\mysql_connect.php on line 6
Could not connect to database. Error
I have the sql database as a file 'runningc_bjart.sql' in the root directory but I think the php cant see it so I tried to use easy php administration, phpmyadmin and thought perhaps I should import the 'runningc_bjart.sql' file. So I tried and got an error message ...
Error
SQL query:
--
-- Table structure for table `Blog`
--
DROP TABLE IF EXISTS `Blog` ;
MySQL said: Documentation
#1046 - No database selected
I am not sure what to try next, any help would be really appreciated.
Thank you. Bridget
The error messages are VERY clear.
Error #1: You're using the incorrect credentials, or have forgotten to grant rights on your database to the credentials you're using.
Error #2: You've forgotten to set a default database, so MySQL has no idea which database it should be looking in for the table you're trying to drop.
e.g. you need
mysql_select_db('mydatabase');
or change your DROP query to be
DROP TABLE mydatabase.Blog;
With phpmyadmin, create a new database named runningc_bjart and import the file there. Then search in your project for a config file where the db password is set and change it with your local mysql password