简体   繁体   中英

mysql installation issues - mac osx

I've recently attempted to install mysql on my mac - osx lion.

I followed this guide - http://matthom.com/archive/2009/06/14/installing-mysql-mac-os-x

I can't seem to create a database from terminal, so I assume I've done something wrong in my installation.

When I try -

mysql> create database some_name;

I get -

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'some_name'

Also, I've tried to install phpmyadmin, but it won't let me log in. I get -

#2002 Cannot log in to the MySQL server

Any ideas? I'm trying to get away from using mamp.

To use MySQL via the console, you need to log in first:

$ mysql --user=root --password
Enter password: 

mysql> CREATE DATABASE `some_database` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Query OK, 1 row affected (0.09 sec)

Also, when using PHPMyAdmin, you maybe need to manually set up the login method .

If you run this on mysql:

CREATE USER 'your_mac_user'@'localhost';
GRANT ALL ON *.* TO 'your_mac_user'@'localhost';

You can access mysql command-line with all privileges by simply writing "mysql" on terminal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM