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
Related
I want to build a LAMP Web Server with WordPress using a Raspberry-Pi 3 and I have followed this tutorial:
https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress
I am having some problems with MySQL installation, because using the command
$ sudo apt-get install mysql-server php-mysql -y
I can't select the root password, as written in the tutorial. Then, I am not able to enter the MySQL database with command
$ mysql -uroot -ppassword
neither using
$ mysql -uroot -p
The only way to enter the database is to use (without any password)
$ sudo mysql -uroot
In the last step of tutorial, when I have to select the database connection details, I don't know which password to use.
Can anyone help me?
Thank you!
There are two "roots".
The password for the OS's root is used for sudo.
The password for MySQL's root is used for mysql -u root -p.
There should be no need for sudo mysql .... But when you do it, first the OS has control and either remembers that you are sudo, or prompts something like
[sudo] password for root:
Then mysql gets control and sees the -p, so prompts you:
Enter password:
During the setup, were you ever asked to create a mysql root password? If not, then mysql -uroot would get into mysql without a password. You should create a password then for security.
This is possibly caused by the change that Debian did to MariaDB. They enabled the UNIX socket authentication plugin by default for newer versions. This would explain why no password is required.
If you want to enable password authentication, you could create a separate root user account. This appears to be required to complete the tutorial.
CREATE USER 'root'#'127.0.0.1' IDENTIFIED BY 'my-password';
This creates the user root with the password my-password which you can then add to the WordPress configuration.
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.
When I connect with /applications/mamp/library/bin/mysql -u root -p I enter perfectly to MySQL prompt, but the show databases command does not show any database. However, in phpMyadmin I see all my databases.
Does anyone know what I'm doing wrong?
Make sure you're connecting to the correct port.
I am not connecting MySQL server. I didn't change password. I got following errors.
Connect server error:
Test connection error:
How to solve this problem?
Thank you.
have you tried connecting from a terminal ?
mysql -u root -p -h localhost -P 3306
You can try to reconfigure the password using the installer you downloaded to install Mysql in your machine.
Steps:
Double click your installer
select reconfigure link next to MYsql server
click next till you were asked to set up password. Then Enter your password
Click execute. and you are done. ou can try to connect again.
Check this video for reference.
https://www.youtube.com/watch?v=8L1GKGLmyUk
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