LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2014, 10:33 AM   #1
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Rep: Reputation: Disabled
about the db in xampp


my colleague send a .sql file to me , which is mysqldump from linux mysql db , I want to use XAMPP ( running in windows ) to connect it , I tried to put this files ( .php , .sql files ) to datadir , but still not connect it , the error is as below.

"throw new CDbException('CDbConnection failed to open the DB connection: '." , it seem can not connect the db ,

Would advise does XAMPP supports the .sql db which export from mysql db ? do I need to install any program / driver to use it ? what is the possible reason of the error ? thanks
 
Old 04-27-2014, 02:04 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
XAMPP runs MySQL so the import shouldn't be any problem. XAMPP comes with PHPMyAdmin so you could use that to import a database if you don't want to use the command line.
*Do make a backup before messing with databases.
**Please note XAMPP is experimental: you should avoid exposing it to public / hostile networks.

Last edited by unSpawn; 04-27-2014 at 02:06 PM. Reason: //More *is* more
 
Old 04-27-2014, 09:38 PM   #3
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
XAMPP runs MySQL so the import shouldn't be any problem. XAMPP comes with PHPMyAdmin so you could use that to import a database if you don't want to use the command line.
*Do make a backup before messing with databases.
**Please note XAMPP is experimental: you should avoid exposing it to public / hostile networks.
thanks reply ,

does it mean XAMPP is not support to use SQL db , it only support mysql db , so that I have to import the data to mysql db ?

thanks
 
Old 04-28-2014, 12:03 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
As Moderator said, you should use mysql client i.e. phpmyadmin to import export files. If your file is in .sql format with correct syntax of queries, it should be imported by mysql.

You can try command line to import a database.

Quote:
/opt/lampp/bin/mysql -h localhost -u username -p'password' "database-name" < "/path/of/the/sql/file.sql"
If you do not have username password, it means it may be root and blank. In case you can try
Quote:
/opt/lampp/bin/mysql -h localhost -u root -p "database-name" < "/path/of/the/sql/file.sql"
when it asks for password, Just press the return key without enter anything.
If you are not able to log in using host "localhost", you can try your IP or 127.0.0.1

Last edited by eklavya; 04-28-2014 at 12:06 AM.
 
Old 04-28-2014, 04:57 AM   #5
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by eklavya View Post
As Moderator said, you should use mysql client i.e. phpmyadmin to import export files. If your file is in .sql format with correct syntax of queries, it should be imported by mysql.

You can try command line to import a database.


If you do not have username password, it means it may be root and blank. In case you can try

when it asks for password, Just press the return key without enter anything.
If you are not able to log in using host "localhost", you can try your IP or 127.0.0.1
thanks reply ,

The .sql files are exported from linux , what I would like to do is import this files to mysql db in windows ( not in linux ) , phpmyadmin can do that ? thanks
 
Old 04-28-2014, 05:30 AM   #6
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by byran cheung View Post
thanks reply ,
The .sql files are exported from linux , what I would like to do is import this files to mysql db in windows ( not in linux ) , phpmyadmin can do that ? thanks
Yes phpmyadmin can do that.
The default import file size may be 2 MB but you can increase in your php.ini.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XAMPP 1.7.7 - XAMPP: Couldn't start MySQL sonic656 Linux - Software 2 10-09-2011 12:43 PM
XAMPP and it's problem Hamzah Hussein Linux - Software 7 12-17-2009 11:11 AM
Xampp kscallions Linux - Newbie 1 02-17-2008 09:14 PM
xampp charnel Programming 0 07-15-2005 07:14 AM
XAMPP, your opinions? Hal Linux - Newbie 1 11-27-2003 10:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration