• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mySQL connections

 
tom davies
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wasn't really sure where to put this, but i will stick with here for now.
I have installed mySQL onto my mac and i want to create some java programs which will connect to it, i have yet to create the database so when i try and connect i get an error message saying Unknown database 'databaseName'.
Could anyone tell me how to access mySQL to create this new database via the terminal? I have searched and nothing so far seems very clear. Alternatively is there any programs that would help manage the databases? i have used phpMyAdmin online but not locally. I assume all i need to do for this small problem is access via terminal and create the database though?
 
Henry Wong
author
Marshal
Pie
Posts: 21446
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

One option is to use the command line tool to connect to MySQL -- which for MySQL, I think it is simply "mysql". From there you can just do a "create database" command to create the database, followed by "create tables", unless of course, you want your application to do that.

Henry
 
Tony Docherty
Bartender
Posts: 2974
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure about mac's but for windows MySql comes with a command line program called MySQL.exe which allows you to execute SQL statements.
If you want a GUI based tool try MySQL Workbench which I believe is available for the Mac.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49865
71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will find the JDBC tutorial here, and there are lots of SQL tutorials on the web. That will probably get you started off. There is also a MySQL handbook which you can download.

This thread would fit better in our databases fora, as somebody told me, so I shall move it.
 
tom davies
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys, MySQL workbench was the program i was thinking of, i just couldn't remember the name after using it a while ago.
Connection is established and database is created.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic