3

phpMyAdmin configuration storage (phpMyAdmin/doc/html/setup.html#linked-tables) says

[..] and then create new tables by importing examples/create_tables.sql

This is not explicit. Where do I 'import' this file? Is it an SQL script I have to execute? how? Where will these tables be created?

Frederic Close
  • 9,389
  • 6
  • 56
  • 67
user2789862
  • 31
  • 1
  • 2

5 Answers5

3

Open the command line;cd to the directory that contains the mysql executable; type mysql and log into the your server, then choose a database.

Now you can type source /path/to/my/sql/file.sql

Ryan
  • 14,392
  • 8
  • 62
  • 102
2

Following exactly what is said in your question:

  1. In my phpMyAdmin directory I can find the /examples/create_tables.sql script.

  2. Right when you open phpMyAdmin there is a tab labeled Import where you can click on a button to browse on your computer for that file. Then you can just click Go.

The script seems to only create a database called phpMyAdmin and then creates tables inside that database so that's where the tables will be located.

ApplePie
  • 8,814
  • 5
  • 39
  • 60
  • According to the documentation, it's suggested to edit the password, username, and database name to fit your needs. So yes, by default the database name is phpmyadmin, but it's easy to change if one needs to. – Isaac Bennetch Nov 11 '13 at 00:25
  • @IsaacBennetch my point was more that OP was very lazy not to actually check at all. I had no idea what this article was about but I just happened to have phpMyAdmin installed and tried it. – ApplePie Nov 11 '13 at 01:41
  • "In my phpMyAdmin directory" - may well be confusing the Original Poster. There's certainly no examples folder in /etc/phpmyadmin or /usr/share/phpmyadmin on my Ubuntu box. Perhaps you should consider varying installations before accusing people of laziness? – Hamish McNeill Apr 11 '15 at 19:53
  • Ah - it's zipped up in /usr/share/doc/phpmyadmin/examples ! – Hamish McNeill Apr 11 '15 at 20:00
1

If you've installed phpMyAdmin as an openSuSE package, the location of create_tables.sql is

/usr/share/doc/packages/phpMyAdmin/examples/create_tables.sql

You can get more help here: https://en.opensuse.org/SDB:LAMP_setup#Installing_phpMyAdmin

Ahmad
  • 12,336
  • 6
  • 48
  • 88
1

Here are the steps how you can import the old DB:

Importing the phpmyadmin database

  • The phpmyadmin database stores details of table relations, bookmarks, history, and so on. Setting up the database simply involves importing an .sql file.

  • Launch phpMyAdmin, make sure the home screen is selected, and click the Import tab.

  • Click the Browse button in the File to Import section, and navigate to the folder where the phpmyadmin files are located. In MAMP, this is /Applications/MAMP/bin/phpmyadmin. And in XAMPP (if installed in C:) C:\xampp\phpMyAdmin\

  • Open the examples folder, and select create_tables.sql.

  • Click Go at the bottom of the Import tab to import the phpmyadmin database structure

Hope steps are helpful for you.

Dhaval
  • 901
  • 3
  • 8
  • 26
-1

The examples/create_tables.sql file is a file that you provide. This file is an export, or data dump of a database. phpMyAdmin allows you to create and populate a new table by using the data in that file.

However, phpMyAdmin allows you to create tables from scratch.

http://php.about.com/od/learnmysql/ss/create_tables.htm

  • 1
    That's false. The create_tables.sql script comes with the phpMyAdmin installation in the `/examples` folder. It's not a script that you have to create / supply. – ApplePie Sep 18 '13 at 03:10