I am new to MySQL.
There is an environment where mysql is installed and DB set up in an Linux server.
Is it possible to access the db using windows command prompt?
What would be the best way to access the db remotely from windows machine?
If you are a new user , use some gui tool to control mysql like https://code.google.com/p/sqlyog/wiki/Downloads . It will be easier for you.
You have to use the -h option
mysql -u<user> -p -h <dbhost>
for example:
mysql -uroot -p -h myql.servername.com
Your user needs remote permissions at your host.
Related
My windows10 is not starting up but I have installed Ubuntu along with windows.
I have some mysql databases in my windows environment which I need backup so is there any way to open windows version of the databases in ubuntu so I can export that databases.
after handling JoSSte above comment you need to run these command in terminal
mysql -u user_name -p this command will ask for password
after successfull above command , you can check your database using below command
show databases;
if your database is there you can export database using below command
mysqldump -u your_db_user_name -p [database_which_need_to_export] > database_name.sql
this command will give you sql file then you can import it using command or in phpmyadmin
I have heroku app running using a Jaws Maria db as a add on, I want to access the database using xampp's mysql on windows 7 machine. I got my database url via
heroku config:get JAWSDB_MARIA_URL --app MYAPPNAME
which got me a string like
mysql://username:password#serveraddress:3306/dbname
i'm trying to access this database url via the command from my cmd
E:/xampp/mysql/bin/mysql -u username -h serveraddress.amazonaws.com -P 3306 -D dbname -p
accoring to the thread Access mysql remote database from command line
after providing the password im getting an error
Can't connect to MySQL server on 'serveraddress.amazonaws.com' (10060 "Unknown error")
Whereas if i try to connect to ths database from c9.io I can access it using the command
mysql -u username -h serveraddress.amazonaws.com:3306 -p
Can anyone help me so that I can access it from xampp's mysql in windows as well. Cant figure out what am I missing here
I have a MySQL server installed in a remote Ubuntu VM that i access using a VPN and i have some sql scripts that i want to run on that server, to create new Stored procedures and queries.
The the details of the virtual machine are:
IP: 192.168.58.61
Hostname: les12a.fi.fr
I am using putty and i am writting directly the commands, but i would like to run directly a script that is on my Windows machine.I have tried using Source, and path but this works fine when MySQL is on my machine. What is the correct syntax to do that on remote server?
just do:
shell> mysql -u user -p -h HOSTNAME DBNAME < yourscript.sql
HOSTNAME: put the hostname if could be resolved or the ip of the remote server
enjoy
SSH to your server, and then run:
mysql -u USERNAME -p DATABASE_NAME < scripts.sql
Obviously, your scripts should be stored in scripts.sql, which should be in your working (current) folder.
Can any one help me to use phpmyadmin mysql database through terminal.
I am using ubuntu 10.4.
I guess the command like this /opt/var/usr/ mysql. I'm not sure about it.
In terminal just type:
mysql -u username -p
and afterwards you'll be prompted for your password.
Normally MySQL is added to /bin/ so no need to explicitly give a path to it.
Answer:
The Below command used to access phpmyadmin mysql database though terminal
/opt/lampp/bin/mysql -uroot -ppassword
I am running mysql server on my computer.I would like to copy the databases i have created and their tables to a remote server,and that is my website.Is there a software(a windows software) that can help me copy my databases to a remote server?.
If you have external access to both mySQL servers, HeidiSQL is a great Windows GUI for mySQL with a good export function.
Alternatively (also needing external access), install the mySQL binaries on your machine and do a simple
mysqldump -h hostname_source -u username -p databasename > dump.sql
mysql -h hostname_target -u username -p databasename < dump.sql