Trouble with importing mySQL database

I had someone create a php form and database.sql which I need to get up and running urgently … problem is my guy is away for a week and I’m stuck with next to no php knowledge (although keen to learn whatever I can)

My problem is that I can’t successfully upload the database.sql file that he has provided …

He had a test site where it all seemed to be working ok but I am having trouble loading everything onto my site now …

These are the steps I have taken.

  1. I’ve created a database, username and password through the MySQL Database wizard in CPanel
  2. I open phpMyAdmin and can see the database that I’ve created.
  3. I click on that database and then to the IMPORT tab
  4. I choose the database.sql file that he created and click Go
  5. After 20secs or so I get the ‘result’ - "MySQL returned an empty result set (ie zero rows). (Query took 0.0007sec) …… a little further down it says “No tables found in database”
  6. I click on the database that I created (through MySql) and there is nothing in the drop down…
  7. I click on the Query and Export tabs and it says “No tables found in database”

I tried this several times… same result each time.

I can’t work out how to attach a file or an image so I’ve just copied the code for the first part of the file … maybe there’s something there that will give you a clue to the problem?

Please help me if you can! Thanks

– phpMyAdmin SQL Dump
– version 3.4.11.1
http://www.phpmyadmin.net

– Host: localhost
– Generation Time: Nov 03, 2013 at 02:01 PM
– Server version: 5.5.34
– PHP Version: 5.2.17

SET SQL_MODE=“NO_AUTO_VALUE_ON_ZERO”;
SET time_zone = “+00:00”;

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/
!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
/
!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
/
!40101 SET NAMES utf8 */;


– Database: samueljh_flight

CREATE DATABASE samueljh_flight DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE samueljh_flight;



– Table structure for table KM_passwords

DROP TABLE IF EXISTS KM_passwords;
CREATE TABLE IF NOT EXISTS KM_passwords (
id int(11) NOT NULL AUTO_INCREMENT,
password varchar(30) NOT NULL,
destination varchar(30) NOT NULL,
row int(10) NOT NULL,
seat varchar(10) NOT NULL,
used int(1) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1001 ;


– Dumping data for table KM_passwords

INSERT INTO KM_passwords (id, password, destination, row, seat, used) VALUES
(0, ‘test’, ‘Melbourne’, 20, ‘B’, 0),

then the table continues …and then at the end, after the table …



– Table structure for table KM_users

DROP TABLE IF EXISTS KM_users;
CREATE TABLE IF NOT EXISTS KM_users (
id int(11) NOT NULL AUTO_INCREMENT,
firstname varchar(50) NOT NULL,
lastname varchar(50) NOT NULL,
email varchar(100) NOT NULL,
mobile varchar(20) NOT NULL,
suburb varchar(50) DEFAULT NULL,
password varchar(50) NOT NULL,
date_registered date NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=62 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /;
/
!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /;
/
!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

simplest thing to do is go into phpmyadmin and import the sql file that way. then you don’t need to create a script to do it through php.

He was trying to use phpmyadmin… :wink:

OP: try to not create a database, the dump script tries to do it on its own

CREATE DATABASE `samueljh_flight` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `samueljh_flight`;

Also, plain text passwords? Hope I read that wrong… :o

Thanks for your help … I have little idea what to do here …so what do I delete exactly?

Also the passwords are a combination of letters and numbers (eg XY123) Has that been set up correctly?

They may be random characters, but they’re passed to the database table in plain text, meaning anyone with developer tools for the browser (which are completely free and available to anyone), or other software, can see those passwords.

You need to use some kind of encryption, like md5, sha1, etc… You’d store the encrypted version of the password, then do a comparison on that.

OK, well encryption is all above my capabilities but I’ll look into it …

…but what about the problem with importing the database? Can you identify the reason for my problem and advise me what I should do?

Do I delete the two lines that JimL highlighted?

Is that what is creating the problem in importing the file?

MD5/SHA1 is not encryption, they are hash algoritms. And yes, it is important because people think that storing encrypted passwords is a good idea, which it’s not. When you store a hash of a password you aren’t actually storing the password at all. There is no possible way to calculate your way from the hash back to the password.

That beeing said, MD5 and SHA1 are not considered safe for use with passwords.

I will fix it for you if you can’t. Storing passwords in plain text should (and in many countries is) a crime.

You could try that :slight_smile: without any errors or a complete file it’s hard to say.

JimL

I tried deleting those two lines you highlighted but still it is the same problem … and I still get the message

"MySQL returned an empty result set (ie zero rows). (Query took 0.0007sec) …… a little further down it says “No tables found in database”

Is there anything else it could be do you think?

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service