Avatar of bish wakim
bish wakim
 asked on

how can I transfer my MySQL database from my localhost to my WebSite??

My app(Done with Delphi) uses a local MySql database in home netWork Environment. Several users can access my database  at the same time from within my home NetWork.
I wish be able to transfer my database to my WebSite so my database will be accessed from users from everywhere.
I have a website powered my Servage.net and have what I need to access my domain.
Please I need step by step directives in order  to transfer my database to my website. I am actually use MySql WorkBench!
Thanks in Advance
DatabasesNetworkingMySQL Server

Avatar of undefined
Last Comment
bish wakim

8/22/2022 - Mon
Julian Hansen

Logon to MySQL Workbench

Export
- Select Server => Data Export
- Select the database you want to dump from the dialog by checking the appropriate checkbox
- Select "Export to Self Contained File"
- Browse to where you want the file saved
- Check OFF "Skip Table Data" (bottom right)
- Click Start Export
(You will be asked for your DB password during this process)

Clean Export
- Open exported file and remove first two lines
CREATE DATABASE  IF NOT EXISTS `YOURDB` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `YOURDB`;

Open in new window


Importing depends on what is available on your server - if you are able to connect via WB then do as follows
Import - WorkBench
- Select Server => Import
- Select Import from Self Contained File
- Browse to file saved in step 1 above
- Select target database from "Default Target Schema" dropdown
- Click Start Import.

Import - PHPMyAdmin
- Logon to PHPMyAdmin
- Select Database from DB list on the left
- Click Import
- Click Browse and browse to the file you saved in step 1
- Click Go
NB With most PHPMyAdmin installations you can upload a .zip of your SQL file. If you use this option your file must be named
XXXXXX.sql.zip
Where XXXXXX is a name you choose
bish wakim

ASKER
It seems this is what  I need. I will try and come back to you later!
Thanks
bish wakim

ASKER
Hello again Julian
I need answers to some Questions in order to proceed:
1. in the export section I did not see bottom right to check off "Skip table data"
2. do you mean I can use import-WorkBench only without using import-PHPMyAdmin?
3. I think I succeeded to export my database to a location in my computer. I am using FileZilla to access my web site. So what then? is it enough that I upload my database file to there?
Please don't let me down!
thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
David Favor

If you read through Julian's directions carefully, you'll require a step in your hosting setup to...

1) Create an empty database.

2) Import your data into your empty database.

For this you'll normally use phpMyAdmin or commands to directly create + load a database on the command line. Something like this...

db-create --dbname=foo --dbuser=foo --dbpass=MEGnuXScxyk6Xlr9
pv foo.sql | mysql --defaults-extra-file=/etc/mysql/debian.cnf --default-character-set=utf8 foo

Open in new window


You can't use sftp for this. You'll use a specific tool or command sequence designed to create + load your database.

Also, if you use a CMS like WordPress, you can use a backup/restore plugin like Duplicator or BackupBuddy, which create a zip file + installer file, so in this case you just create an empty database using your hosting panel system or phpMyAdmin + then copy the .zip data file + installer.php file to your site using sftp + navigate to the installer.php file with a Web browser + follow all instructions presented to you.

If this is your first time going this process, you might consider hiring someone to assist you.

Have them make a video of all their steps, so you can do this yourself in the future.
bish wakim

ASKER
Yes this is my first time. I thought it would be simple.
You are right. I had better hire someone to assist me.  
may you help me to find somebody?
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
bish wakim

ASKER
Hello David
As a matter of fact my application should not run in the web. However with the help of FireDac component  it is possible to retrieve data easily from my WebSite(This is what I need)

Thank you for you both. I will try to transfer MySql file to my WebSite using WorkBench.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.