Can not save database RDS in AWS - mysql

I am new using AWS and using Putty. I know this is a stupid question, i am searching today to find the answer but still can not solve my problem. I want to download my database from RDS AWS. I have try this to download:
mysqldump -h ***.rds.amazonaws.com -u *** -p ****> dump.sql
and then insert my password. and it work. when i entered ls, then there will be dump.sql with green colour.
then i try to download it using this command:
mysql -u root -p local_db < dump.sql
then it will require a password, what password that mean? Then i click enter without insert any password.
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
How i can solve this?

I'm not sure what you want to do, Do you connect to AWS RDS from a EC2 instance? where is the dump file?
EDIT: If the file is in a EC2 instance or server and you want to download it You shoud use filezilla or SCP.

Related

SQL database connection problem - missing databases

I am quite stressed, I am afraid I have lost my databases. I wanted to access my database from another laptop, but I finally lost the connection to my databases, and when I found it again, my databases were gone.
I hope you will be able to help me or perhaps have some encouraging leads.
I wanted to access my database from another laptop, so I tried to change my hostname from "localhost" to my IP address on MySQL Workbench. This way I could not connect to MySQL, I tried to change my hostname back to "localhost" but I could not connect either.
Finally, since I'm on a Mac, I went to System Preferences > MySQL > Initialize Database, and changed to use legacy password encryption, as suggested in a tutorial. Then I can connect to the server, but there are none of my databases, just the original "syst" database.
Are you able to connect to your MySQL via command:
mysql -u username -ppassword (no interval after -p)
(bear in mind that you have to be in the bin dir of MySQL) for example using XAMPP in cmd, I can connect via the following commands:
cd C:\xampp\mysq\bin
mysql -u root -ppassword
If you are able to connect try to reach the database via command line like this:
mysql -u username -ppassword --execute="select * from databasename.table"
or just some other query just to check if the database is still there.
This should be done on the PC(or server) where the MYSQL is installed.
If this is working you can manage to fix the issues.

How to change MySQL environment in vagrant server?

What are the correct steps to change the MySQL environment in vagrant?
Yes I found the correct steps to solve this.
Type these command in command prompt
vagrant up
vagrant ssh
mysql -u usernameOfMysql -p
enter the password.
Change to the database-> use databaseName
Copy the mysql code
show tables

MySQL remote access from windows cmd prompt

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.

How to use phpmyadmin mysql database using terminal in ubuntu 10.4?

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

Unable to login to MySQL instance hosted on AWS ec2

I am trying to set up a mysql database on an aws ec2 instance (SUSE 32-bit with mysql pre-installed). However, I can't log in to mysql as root user:
mysql -u root
Access denied
without a password, so is there a way of getting one? I believe that root user is blocked and hence should login with ec2-user. However, when I do
mysql -u ec2-user
the user does not have the priviledges to create a database.
I'm a not very familiar with linux, so if I'm simply doing this completely wrong, then do say.
Any help would be greatly appreciated.
The fact that this server is on EC2 is irrelevant. SUSE and MySQL do not know this. Amazon cannot block anything, you have root access to the server. You recover/change the root password the same as any server, with mysqladmin, or by starting mysqld with --skip-grant-tables while you make the change.
mysql -u root -p
Then press enter.
I know, this isn't a direct answer to your question, but I would recommend using the AWS Relational Database Service. Amazon will host a MySQL database for you and take care of all the setup, maintenance, scaling, backup, etc.
http://aws.amazon.com/rds/