can't import into phpmyadmin - mysql

I have a local wamp server and a live phpmyadmin/mysql via cpanel.
I am trying to import the wamp one into the live one. I have done this before without issue for different sites but this time I get
Create database if not exist 'test'
#1044 - Access denied for user 'c2920553'#'localhost' to database 'test'
My local database is called simply 'test' but my live one is called 'c2920554_test'
I am sure I am doing something wrong but I can't figure it!
Very happy to post more info if needed

I deleted out of the WAMP export the line that said
CREATE DATABASE IF NOT EXISTS `test` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `db-name`;
and now it seems to work.
I don't know why though...

Related

Can't upload MySQL database in phpMyAdmin - Migrating wordpress from local host to live site

I am at a very beginner level. I am creating a website, and did all of it with Wordpress on localhost. Now I bougth a domain name with GoDaddy hosting, and would like to pass my site from this local server to the live site.
I followed steps of these tutorials :
http://www.wpexplorer.com/wordpress-local-to-live/
-//- wpbeginner.com/wp-tutorials/how-to-move-wordpress-from-local-server-to-live-site/
But when getting to step 4 ( for the both of them) which is "Upload Database File into New Database / Importing WordPress Database on Live Site"
I am confronted to a problem I cannot seem to resolve even with all the online manuals and forums.
SQL query:
--
-- Database: `a'
--
CREATE DATABASE IF NOT EXISTS `a`
DEFAULT CHARACTER SET latin1
COLLATE latin1_swedish_ci;
MySQL error message:
#1044 - Access denied for user 'x'#'localhost' to database 'a'
-> I created a MySQL database (online) in Cpanel Interface named "arctic" user "artic" used as well "paul" or others to try to see if the problem came from that.
--> then I exported my database on phpMyAdmin (on local) to a .sql file. changed the lines mentioning http://localhost/arctic to www.arctic-international.com as advised in a those tutorial (the 1st one)
---> NOW I try to import this file to the phpMyAdin (online) and I get this message
SQL query:
--
-- Database: `arctic`
--
CREATE DATABASE IF NOT EXISTS `arctic`
DEFAULT CHARACTER SET latin1
COLLATE latin1_swedish_ci;
MySQL error message:
#1044 - Access denied for user 'cpses_arkjRXZnzq'#'localhost' to database 'arctic'
I do not understand and even tried to create user "cpses_arkjRXZnzq" and grant it all permisions but it still doesn't work.
I am not expert at all but I'm trying to learn, but I do need this site up and running and would really do with some help. SO please if you have any idea it would be great to hear about it.
Thanks in advance !

Migrating Wordpress database to server SQL error

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

Import MySQL database with phpMyAdmin

I'm getting an error:
#1044 - Access denied for user 'host_adminman'#'localhost' to database 'testdb4'
I thing that it should be denied, since the user/pass combo for MySQL 5.6 that was used on my PC while developing DB do not match ones I got from host. I've found explanation from HostGator that:
"The problem here is your import file contains an SQL query that attempts to create a database for the wrong username. Notice the user2 in 'user2_wrdp9' does not match the username1 in 'username1'#'localhost'. Someone must edit the import file and change the old user2 to your new username1.
So, how do I do that?
I have MySQL Workbench installed. Added, the same username as on the host, gave it all privileges to 'testdb4', exported database in a SQL file, but I still get this error when I try to import it on the host.
Did somebody use phpmyadmin to create this import file?
If so, can you get them to do it again?
If so, can they use the "custom-display all possible options" item in the phpmyadmin export panel? That will allow them to uncheck the "Add CREATE DATABASE / USE statement" and redo the export. That should get rid of your problem with the import.
If you can't get the export file remade, you can use a simple text editor (for example, the notepad program on Windows) to fix up the import SQL file.
If the filename ends in .zip or .gz or some such, you need to uncompress it first.
Then open it up in the text editor. Right near the beginning of the file you'll find lines like these:
--
-- Database: `blah_blah`
--
CREATE DATABASE IF NOT EXISTS `blah_blah` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `blah_blah`;
Delete them and save the file. Then try importing it again.

Getting an error while importing the database from local to live server

i am getting an error while importing database from local to live server,
SQL query:
--
-- Database: `ss`
--
CREATE DATABASE IF NOT EXISTS `ss` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
MySQL said:
#1044 - Access denied for user 'secwebs'#'%' to database 'ss'
Can somebody please guide me how can i resolve this?
Thanks in advance.
If you have created a database on the live server, you must have created a username and password on the webhost/provider for the specific database. you will have to edit the wp-config.php file to the new database name/user name/password in order to gain access to the database.
What you need to do is when exporting the database, first of all select the database you want to export then go to the export tab and select all the 'tables of the database' to export it. Instead of exporting the whole database. export just the tables in the database.
Your export is trying to create the database as it is in your local server instead of just creating the tables and populating it on the database you've already created on your live server.
I hope that wasn't confusing.

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