Help - Search - Members - Calendar
Full Version: Restoring a MySQL backup?
Hostony Board > General Support > PHP/MySQL
Dag
Hi all.
Just moved here, and it's probably a bit early to judge but I have to say I'm impressed with how professional everything has been so far. To be fair I'm coming here with low expectations - my last host was frankly not very good - but so far everything's been great. Account activation was extremely quick.

That said, I'm wondering about a quick way to restore the MySQL databases from my old server. I've got a backup, but under phpMyAdmin I don't have permission to create databases. Obviously there's a reason for this because it was the same way on my other server, but it's kind of irksome because it means I can't use the backup I have.

Now, I CAN create the databases manually from CPanel and edit the backup so that it'll work, but that's kind of painful. Nothing totally horrible, I just thought I'd ask (since I've got other stuff to do in the meantime) - is there a quick way to get this done?
caner.us
Everbody has right to create a database

To do it:Login to cpanel, go to "MySQL databases" page. Create the database from that page(not from phpMySQLAdmin) and also create a user for the database. Then open phpMyAdmin, you will see your database in the combobox on the left. Choose your database, then choose SQl link on the database screen, then import your backup file either by uploading or copy/pasting.
caner.us
Sorry, I misunderstood your question. You can do it by first connecting through ssh to the server and runing the following command:
mysql -u <username> -p

Then enter password, once you login to mysql paste the database dump.

I hope I got it right now smile.gif
artrocity
or from your shell account you can type

mysql -uusername -ppassword < backup.sql

you can do this somewhere in control panel under the phpmysqladmin
if you like clicky better.... wink.gif
Dag
SSH is fine, I just need to get it set up with support first. In the meantime I'll see what I can do with cPanel. There's the "restore a MySQL backup" thing, but I'm pretty sure that's expecting it in a different format.

Thanks for your help.

============================================

EDIT

I realized that I have fewer databases than I thought, so I'm just downloading individual gzipped backups and restoring them via cPanel's backup page. By the way, I think I figured out why phpMyAdmin can't create databases - you know how when a database is created, your account name is prefixed to it so that databases can't be mixed up? To make phpMyAdmin do that, Hostony would probably have to edit the code, which I guess they don't want to get into. At least, that's my theory.
Hype
Hi I'm thinking about moving my domain kompamania.com here, but wondering if my mysql database can have the old name they used to have for exemple: kompamania_com, kompamania_com5.......
I need this because I want to retore my old databases with my backups.
Alec
Hype:

Here are rules of formation of databases on our server.

On Windows platform you can name you database as you want and limit is only number of characters and using of illegal characters. And evidently, that you can't name database. e.g. test, if this name is already taken by another user on your server.

On Linux, your database names consists of 2 parts: username prefix and proper database name which you can define. The first part is limited to 8 symbols. So, for example, if your username us someuser and database name is somebase, full database name will be someuser_somebase.

The name like kompamania_com is not compatible with cpanel, but we can easily rename it without any data lost. And you can it another way: create a new database with a new name from control panel, then import dump file to it and update your site configuration files.
Hype
thanks for the promp response
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here