I'm unable to get access into mysql via terminal. I've installed MAMP on my MacOS High Sierra (10.13.5).
Apache & MySQL started, but after prompting the command:
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot
nothing happens.
P.S. Path leading to MAMP binaries is correct.
screen from terminal
Unfortunately, I didn't find solution at StOvfl.
Related
I installed MySQL with brew using the command brew install mysql and it installed MySQL correctly, but it gave me instructions that say:
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
So I ran the command mysql_secure_installation, and it asked me for a password for the user root, and when I entered the password, it gave me this error:
The user provided does not have enough permissions to continue.
mysql_secure_installation is exiting.
I tried running mysql -u root -p and entering in the sql terminal, but I am not able to run any query because I don't have access to do anything. Also, not able to grant any access to the root user.
I also tried to uninstall MySQL from my laptop and install it again, but again the same problem occurs.
Does anyone have a solution for this?
I have downloaded macOS 10.13 (x86, 64-bit), DMG Archive and install it on my Mac(10.13.6) but while accessing it in terminal it's not taking root password which I have set during the installation process.
I have checked system preference MySQL is running and trying to access MySQL by below command, though it's asking for the password but not taking it after trying it, its giving below error
sudo /user/local/mysql -u root -p
error : sudo: /user/local/mysql: command not found
You didn't install mysql there. Double-check where it's actually installed. You'll probably be able to use plain old mysql as the command name.
i have installed mysql community, but when i write the comand mysql -u root -p windows says the command not exist...how can i resolve it?
I have been learning Ruby on Rails and have been using the command line successfully to view and edit the database (using the mysql command).
I am now using MAMP and trying to install Wordpress. It appears that it is using a "different" mysql. I.e., databases I create via the command line aren't viewable in MAMP's phpmyadmin, and vice versa.
How can I access MAMP's mysql via the command line? I'm guessing that I need to specify the host when logging in with the mysql command, but I'm not sure what to put there. Since phpmyadmin exists at localhost:8888/phpMyAdmin, I tried using mysql -h localhost:8888 -u root -p, but that didn't work (error: Unknown MySQL server host 'localhost:8888').
MAMP installs it's own MySQL which means that you now have two MySQL instances installed on you machine.
try typing this in your terminal
/Applications/MAMP/Library/bin/mysql
You can also add this to your a bash_profile so you don't have to write /Applications/MAMP/Library/bin/mysql each time by running in terminal :
sudo vi ~/.bash_profile
and adding
alias mysql="/Applications/MAMP/Library/bin/mysql"
Then, from terminal you can run : mysql -uroot -proot notice theres no space for this to work.
After upgrading to Lion I can still start MySQL via System Preferences -> MySQL
When I try and login with the root user and password I was using on Snow Leopard I get this error via phpMyAdmin
#2002 Cannot log in to the MySQL server
Via the MySQL Query Browser however I get code 2003
If I try via Terminal with mysql -u root -p I get the error
-bash: mysql: command not found
Thanks for any help.
There was a problem with the socket and I had to change occurences of /var/mysql/mysql.sock to /tmp/mysql.sock as stated here http://birdchan.com/home/2011/07/20/osx-lion-mysql-sock-path/