Importing sql file using phpmyadmin in EasyPHP
Asked Answered
R

3

25

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 have the sql database as a file 'runningc_bjart.sql' in the root directory. I first use php admin to create a database of the same name as the orginal and then use import ... one table appears to be created but then getting an error... Error

SQL query: DocumentationEdit Edit

SELECT  `comment` 
FROM  `phpmyadmin`.`pma_column_info` 
WHERE db_name =  'runningc_bjart'
AND table_name =  ''
AND column_name =  '(db_comment)'

MySQL said: Documentation

#1100 - Table 'pma_column_info' was not locked with LOCK TABLES 
---------

Error
SQL query: DocumentationEdit Edit

SELECT  `comment` 
FROM  `phpmyadmin`.`pma_column_info` 
WHERE db_name =  'runningc_bjart'
AND table_name =  ''
AND column_name =  '(db_comment)'

MySQL said: Documentation

#1100 - Table 'pma_column_info' was not locked with LOCK TABLES 

I am not sure what to try next, any help would be really appreciated. Thank you. Bridget

Re answered 13/8, 2013 at 17:20 Comment(0)
R
56

Having wasted many hours, I have a solution so here it is.

Having a look on the web I found I needed to change my config.inc.php file in the phpadmin directory as I was running EasyPHP 13.1 password slightly diff to that mentioned in the blog at http://amir-shenodua.blogspot.co.uk/2012/03/error-while-importing-db-in-mysql.html. I added 2 lines:

$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = '';

So all sorted !! Yippee!!

So if you have trouble please read:
http://amir-shenodua.blogspot.co.uk/2012/03/error-while-importing-db-in-mysql.html

Re answered 14/8, 2013 at 8:17 Comment(2)
I originally thought it was a bug in phpMyAdmin, but Bridget's solution worked for me. Looked like I had set up the phpMyAdmin configuration database, but without specifying a controlhost, controluser or controlpass. For some reason phpMyAdmin dies when importing scripts that use LOCK TABLES if those configuration items are missing. Thanks for the tip!Lecturer
In later versions of EasyPHP those variables are commented out and have pre-existing values, but they won't work. Use the value as specified by @bridget-jones (or whatever you have set your mysql config values as)Boer
H
2

For temporary relief:

Comment out this line in your config.inc.php file (place // before the line)

$cfg['Servers'][$i]['pmadb'] = $dbname;

Then close all browsers. Try importing again.

Halves answered 9/7, 2015 at 15:51 Comment(0)
U
2

As an alternative to modifying phpMyAdmin's config.inc.php as proposed in other answers, if you have shell access then you can directly execute this file using the MySQL console client.

First, change directories to the folder containing your DDL script runningc_bjart.sql

Then run this command, replacing the values for host, user, password, and database name:

mysql --host=database_server --user=database_user --password=database_password --database=database_name < runningc_bjart.sql

This ran just fine without the error received when importing via phpMyAdmin

Unexceptional answered 22/5, 2016 at 21:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.