Mac Manual Mysql

Oracle's MySQL is a popular open-source relational database management system that is based on Structured Query Language (SQL). It is frequently used in conjunction with PHP to enhance the capabilities of websites. PHP comes preloaded onto Mac computers, but MySQL does not.

Active2 years, 11 months ago

Can any one please let me know how to create new user and new db in MySQL? How to use mysqladmin in Mac OS X?

Loïc Wolff
13.5k4 gold badges40 silver badges62 bronze badges
Sarbbottam BandyopadhyaySarbbottam Bandyopadhyay
1721 gold badge2 silver badges10 bronze badges

5 Answers

If you are using the terminal client, generally you can do things like reset the root users password for mysql or create databases.A simple example can be found at the MySQL docs site, of which I will copy the highlights.

To create a new MySQL user:

  • Login to MySQL in Terminal:mysql -u username

  • In the prompt:CREATE USER 'admin'@'localhost';GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost';

  • If you want to create a database: create database name; is all you need to do

If you do decide to use mysqladmin, mysqladmin can create and drop databases, but it cannot create new users.

ConstantineKConstantineK
Davide GualanoDavide Gualano
6342 gold badges10 silver badges21 bronze badges

Thanks everyone. I used the below commands to figure it out.

nohillside
56.4k14 gold badges118 silver badges166 bronze badges
Sarbbottam BandyopadhyaySarbbottam BandyopadhyayDownload
1721 gold badge2 silver badges10 bronze badges

You have many choices, you can use MySQL Query browser , or PhpMyadmin.

Am1rr3zAAm1rr3zA
10.3k10 gold badges58 silver badges85 bronze badges

Try, introduce complete path to mysql:

Go to Terminal:

I hope help you!

How to install mysql on mac
Jose Carlos Ramos CarmenatesJose Carlos Ramos Carmenates

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged mysqladministrator .

Active24 days ago

I downloaded the mysql dmg file and went through the wizard to run. Done. I have also started mysql server under system preferences.

The purpose of me doing this is to work through the exercises of my SQL text book. The terminal commands are new to me but I think once I can actually get started, working through the exercises should be OK.

From researching the web the various blogs tell me to navigate to to the mysql folder in the terminal: /usr/local/mysql

Fine. Then it gets a little less clear as nearly each article has a different set of instructions on how to proceed. I was fiddling with it yesterday and was prompted for a password - what is the default mysql password?

Could someone give me the steps to get up and running with mysql via the terminal?

Doug FirDoug Fir
6,05229 gold badges96 silver badges170 bronze badges

8 Answers

(Updated for 2017)

When you installed MySQL it generated a password for the root user. You can connect using

and typing in the generated password.

Previously, the root user in MySQL used to not have a password and could only connect from localhost. So you would connect using

Gary GGary G
4,2941 gold badge22 silver badges18 bronze badges

open terminal and type

then close terminal and open a new terminal and type

hit enter, and it will ask you for password

Manual

I have found this solution on https://teamtreehouse.com/community/says-mysql-command-not-found

now to set new password type

knownUnknownknownUnknown

In the terminal, I typed:

I was then prompted to enter the temporary password that was given to me upon completion of the installation.

Brad CannellBrad Cannell
1,0891 gold badge15 silver badges24 bronze badges

If you have your MySQL server up and running, then you just need a client to connect to it and start practicing. One is the mysql-client, which is a command-line tool, or you can use phpMyAdmin, which is a web-based tool.

CynicalCynical
8,0641 gold badge11 silver badges29 bronze badges
Zoe
15.6k12 gold badges65 silver badges96 bronze badges
DanTheManDanTheMan

This command works for me:

(PS: I'm working on mac through terminal)

Fozoro
2,5794 gold badges13 silver badges31 bronze badges
Bijan NegariBijan Negari

try with either of the 2 below commands

/usr/local/mysql/bin/mysql -uroot -- OR --
/usr/local/Cellar/mysql//bin/mysql -uroot

Mac Install Mysql

Aziz ZoaibAziz Zoaib
Adrita Sharma
3,8596 gold badges21 silver badges42 bronze badges

Mac Manual Download

Micky QMicky Q

How To Install Mysql On Mac

Not the answer you're looking for? Browse other questions tagged mysqlterminalinstallation or ask your own question.