Warning

 

Close
Confirm Action

Are you sure you wish to do this?

Cancel Confirm
AR15.COM
Previous Page
/ 2
Next Page
2/12/2008 11:33:19 AM EDT
How in the holy hell do I create a damn database? (MySQL vs. 5.0)
2/12/2008 11:34:43 AM EDT
[#1]
Well here goes...

When a mommy database and a daddy database REALLY love each other........
2/12/2008 11:35:28 AM EDT
[#2]

Quoted:
How in the holy hell do I create a damn database? (MySQL vs. 5.0)


If you arent using phpmyadmin, install that.  It will make things much easier.
2/12/2008 11:36:33 AM EDT
[#3]
If it uses anything close to TSQL, it should be something along the lines of "CREATE DATABASE"

(Seriously, looks like it is create database dev.mysql.com/doc/refman/5.0/en/create-database.html. If it's still given ya troubles tonight, IM me, and I'll download it and see.)
2/12/2008 11:36:43 AM EDT
[#4]

Quoted:
Well here goes...

When a mommy database and a daddy database REALLY love each other........


Hahahahahahahha!
2/12/2008 11:37:32 AM EDT
[#5]

Quoted:
Well here goes...

When a mommy database and a daddy database REALLY love each other........


Bastard
2/12/2008 11:38:04 AM EDT
[#6]

Quoted:

Quoted:
How in the holy hell do I create a damn database? (MySQL vs. 5.0)


If you arent using phpmyadmin, install that.  It will make things much easier.


+1
2/12/2008 11:38:09 AM EDT
[#7]

Quoted:
If it uses anything close to TSQL, it should be something along the lines of "CREATE DATABASE"

(Seriously, looks like it is create database dev.mysql.com/doc/refman/5.0/en/create-database.html. If it's still given ya troubles tonight, IM me, and I'll download it and see.)


I tried the ol' "create database" but maybe I did it wrong. yay. more reading.
2/12/2008 11:38:11 AM EDT
[#8]
<--- mysql 5.0 certified
2/12/2008 11:39:19 AM EDT
[#9]

Quoted:

Quoted:
If it uses anything close to TSQL, it should be something along the lines of "CREATE DATABASE"

(Seriously, looks like it is create database dev.mysql.com/doc/refman/5.0/en/create-database.html. If it's still given ya troubles tonight, IM me, and I'll download it and see.)


I tried the ol' "create database" but maybe I did it wrong. yay. more reading.


what error message did you get? were you at the CLI (command line interface)?

create My_Database; use My_Database;

should do it.
2/12/2008 11:39:21 AM EDT
[#10]
You'd better not fuck anything else up.
2/12/2008 11:39:33 AM EDT
[#11]
I really like SqlYOG.  Much like MS SQL's interface.
2/12/2008 11:39:52 AM EDT
[#12]

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]
2/12/2008 11:41:01 AM EDT
[#13]

Quoted:

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]


Don't ask me, I only know enough MSSQL to use Enterprise Manager to export tables so I can import them into MySQL
2/12/2008 11:43:22 AM EDT
[#14]
make sure you are connected to the MySQL database.

i.e. if you can ssh into your box, run


mysql -u user_name -p -h some.dbhost.com


assuming default port.  if you include the password in the command it's "-pSOMEPASSWORD" with no space after the "-p".
2/12/2008 11:44:32 AM EDT
[#15]
Under linux:

mysqladmin -u root -p create newDBname

-Foxxz
2/12/2008 11:46:29 AM EDT
[#16]

Quoted:
Under linux:

mysqladmin -u root -p create newDBname

-Foxxz


if it's a shared host, he won't have access to mysqladmin.  Is this a dedicated server? (or, are you root?)

eta: in fact, if it's a shared host, they may limit how many databases you can create.
2/12/2008 11:46:50 AM EDT
[#17]

Quoted:

Quoted:

Quoted:
If it uses anything close to TSQL, it should be something along the lines of "CREATE DATABASE"

(Seriously, looks like it is create database dev.mysql.com/doc/refman/5.0/en/create-database.html. If it's still given ya troubles tonight, IM me, and I'll download it and see.)


I tried the ol' "create database" but maybe I did it wrong. yay. more reading.


what error message did you get? were you at the CLI (command line interface)?

create My_Database; use My_Database;

should do it.


Using CLI and I type as you did, I get this error

creat joomla; use joomla


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'creat
joomla' at line 1


This is on a dev box I built at work to test some things....
2/12/2008 11:47:52 AM EDT
[#18]

Quoted:

Quoted:

Quoted:

Quoted:
If it uses anything close to TSQL, it should be something along the lines of "CREATE DATABASE"

(Seriously, looks like it is create database dev.mysql.com/doc/refman/5.0/en/create-database.html. If it's still given ya troubles tonight, IM me, and I'll download it and see.)


I tried the ol' "create database" but maybe I did it wrong. yay. more reading.


what error message did you get? were you at the CLI (command line interface)?

create My_Database; use My_Database;

should do it.


Using CLI and I type as you did, I get this error

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'creat
joomla' at line 1


misspelled "create"

joomla shouldn't have bugs like that in it.  are you using the release version?
2/12/2008 11:49:22 AM EDT
[#19]
MySQO 5.0.5 and Joomla release 1.5

I just misspelled it here. Tried it again and same error
2/12/2008 11:49:37 AM EDT
[#20]

Quoted:
This is on a dev box I built at work to test some things....


Are you logging in as root? your user probably doesn't have "create database" permissions.

eta:
you need the "grant" command.

something like


grant all on *.* to david_g17 identified by 'password';

then log in as david_g17.

yeah, that's a lot of security vulnerabilities.
2/12/2008 11:51:51 AM EDT
[#21]
Oh son of a biznatch.. Im not a *nix box.. Win2k3... crap... Sorry
2/12/2008 11:56:00 AM EDT
[#22]

Quoted:
Oh son of a biznatch.. Im not a *nix box.. Win2k3... crap... Sorry


shouldn't make a difference.  


C:\Documents and Settings\Admin>mysql -u root -p


should log you into mysql as root user. (well, on mine it does, depends on PATH variable)

eta:
crap, if i could remember my password, I could walk you through it.
2/12/2008 11:58:47 AM EDT
[#23]
# mysql
> CREATE DATABASE databasename;
> GRANT ALL PRIVILEGES ON databasename.* TO someuser@localhost
   IDENTIFIED BY 'password';
> quit
2/12/2008 12:02:33 PM EDT
[#24]

Quoted:
# mysql
> CREATE DATABASE databasename;
> GRANT ALL PRIVILEGES ON databasename.* TO someuser@localhost
   IDENTIFIED BY 'password';
> quit


That got me no errors... How can I test it to see if its up?
2/12/2008 12:04:27 PM EDT
[#25]

Quoted:

Quoted:
# mysql
> CREATE DATABASE databasename;
> GRANT ALL PRIVILEGES ON databasename.* TO someuser@localhost
   IDENTIFIED BY 'password';
> quit


That got me no errors... How can I test it to see if its up?





mysql
use databasename;
show tables;
2/12/2008 12:04:51 PM EDT
[#26]
use databasename
show tables;
2/12/2008 12:08:59 PM EDT
[#27]

Quoted:
use databasename
show tables;


mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


Maybe the MySQL instal got hosed...uhg
2/12/2008 12:11:18 PM EDT
[#28]

Quoted:

Quoted:
use databasename
show tables;


mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


Maybe the MySQL instal got hosed...uhg


You did it wrong. It's

show tables; <cr>

Not:

show tables <cr> show tables;
2/12/2008 12:11:45 PM EDT
[#29]

Quoted:

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]


Yea, if you know standard SQL commands then it isn't hard to pickup.  You won't be able to use a lot (if any) of the T-SQL stuff though.  And unless they changed it recently, you can't create stored procedures either.
2/12/2008 12:12:41 PM EDT
[#30]

ignore, subnet found the error.



Quoted:

Quoted:
use databasename
show tables;


mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


Maybe the MySQL instal got hosed...uhg


maybe it needs a table.  

mysql> create table test(id int not null primary key);
mysql> show tables;
2/12/2008 12:13:12 PM EDT
[#31]

Quoted:

Quoted:

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]


Yea, if you know standard SQL commands then it isn't hard to pickup.  You won't be able to use a lot (if any) of the T-SQL stuff though.  And unless they changed it recently, you can't create stored procedures either.


you can do stored procedures with MySQL 5.0
2/12/2008 12:13:35 PM EDT
[#32]

Quoted:

Quoted:

Quoted:
use databasename
show tables;


mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


Maybe the MySQL instal got hosed...uhg


You did it wrong. It's

show tables; <cr>

Not:

show tables <cr> show tables;


Oops....   OK got this back...   Empty set <0.01 sec>
2/12/2008 12:14:05 PM EDT
[#33]

Quoted:

Quoted:

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]


Yea, if you know standard SQL commands then it isn't hard to pickup.  You won't be able to use a lot (if any) of the T-SQL stuff though.  And unless they changed it recently, you can't create stored procedures either.




My world would crumble!

ETA:

Quoted:

you can do stored procedures with MySQL 5.0


My world is returning to balance
2/12/2008 12:14:31 PM EDT
[#34]

Quoted:

Quoted:

Quoted:

Quoted:
use databasename
show tables;


mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


Maybe the MySQL instal got hosed...uhg


You did it wrong. It's

show tables; <cr>

Not:

show tables <cr> show tables;


Oops....   OK got this back...   Empty set <0.01 sec>


There it is. It works. Create a table (see David's thing) and 'show tables' will list it.
2/12/2008 12:15:16 PM EDT
[#35]

Quoted:

Quoted:

Quoted:

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]


Yea, if you know standard SQL commands then it isn't hard to pickup.  You won't be able to use a lot (if any) of the T-SQL stuff though.  And unless they changed it recently, you can't create stored procedures either.




My world would crumble!


Mine already has. I need to learn how to write stored procedures on MSSQL2K, and I'm not sure where to start.
2/12/2008 12:15:26 PM EDT
[#36]

Quoted:
ignore, subnet found the error.



Quoted:

Quoted:
use databasename
show tables;


mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


Maybe the MySQL instal got hosed...uhg


maybe it needs a table.  

mysql> create table test(id int not null primary key);
mysql> show tables;


AHHH HA!!!


mysql> create table test(id int null primary key);
Query OK, 0 rows affected (0.08 sec)

mysql> show tables;
+------------------+
| Tables_in_joomla |
+------------------+
| test             |
+------------------+
1 row in set (0.00 sec)

mysql>



Well looky there, im a lernin sumtin..
2/12/2008 12:18:56 PM EDT
[#37]

Quoted:

Quoted:

Quoted:

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]


Yea, if you know standard SQL commands then it isn't hard to pickup.  You won't be able to use a lot (if any) of the T-SQL stuff though.  And unless they changed it recently, you can't create stored procedures either.


you can do stored procedures with MySQL 5.0


Nice!  That was one of my biggest complaints when I was using it a couple years ago.  I'm glad they added the feature.
2/12/2008 12:19:10 PM EDT
[#38]

Quoted:

Quoted:

Quoted:

Quoted:

Quoted:
<--- mysql 5.0 certified


[hijack] Is it close enough the MSSQL 2K for me to picck it up pretty quick? I need to addd another platform to the resume [/hijack]


Yea, if you know standard SQL commands then it isn't hard to pickup.  You won't be able to use a lot (if any) of the T-SQL stuff though.  And unless they changed it recently, you can't create stored procedures either.




My world would crumble!


Mine already has. I need to learn how to write stored procedures on MSSQL2K, and I'm not sure where to start.


start with convincing them to use open source.

I kid, i kid.

eta: stored procedures:
dev.mysql.com/doc/refman/5.0/en/stored-procedures.html
2/12/2008 12:20:53 PM EDT
[#39]
OK, well, looks like I have a DB now. Now to make it all work together.

But my head hurts now.

THANK YOU FOR YOUR HELP EVERYONE!!!!!
2/12/2008 12:22:35 PM EDT
[#40]

Quoted:

Mine already has. I need to learn how to write stored procedures on MSSQL2K, and I'm not sure where to start.






(Feel free to IM me if you get stuck on something (10 years MSSQL))
2/12/2008 12:23:56 PM EDT
[#41]

Quoted:
start with convincing them to use open source.


Not going to happen, unless you have some pull at Cisco Systems...

(Fear not, though. CallManager is already running on Linux - they're getting there). In the meantime, to write custom reports for UCCX (which stores reporting data in SQL server), I have to write stored procedures, and I have to do it on that platform. That's just the way it is, and I exist to make money, not debate the merits of somebody's DBMS.

I'm not upset that the source isn't available, and the lack of source code isn't what my problem is. I'm upset because I don't know how to write stored procedures on SQL2K.
2/12/2008 12:26:18 PM EDT
[#42]

Quoted:

Quoted:

Mine already has. I need to learn how to write stored procedures on MSSQL2K, and I'm not sure where to start.


i68.photobucket.com/albums/i6/Boomer8450/darkside.jpg



(Feel free to IM me if you get stuck on something (10 years MSSQL))


Give me a place to start (book, website, anything).
2/12/2008 12:31:03 PM EDT
[#43]

Quoted:

Quoted:

Quoted:

Mine already has. I need to learn how to write stored procedures on MSSQL2K, and I'm not sure where to start.


i68.photobucket.com/albums/i6/Boomer8450/darkside.jpg



(Feel free to IM me if you get stuck on something (10 years MSSQL))


Give me a place to start (book, website, anything).


I've heard the MSDBA books that Microsoft publishes are the best out there.  But, I can't verify it.  I like o'reilly books a lot, but they're pretty limited on MS stuff.


(I confess, I looked into getting a MSDBA a while back).
2/12/2008 12:31:24 PM EDT
[#44]

Quoted:

Quoted:

Quoted:

Mine already has. I need to learn how to write stored procedures on MSSQL2K, and I'm not sure where to start.


i68.photobucket.com/albums/i6/Boomer8450/darkside.jpg



(Feel free to IM me if you get stuck on something (10 years MSSQL))


Give me a place to start (book, website, anything).


These videos don't seem too bad:

www.learnsqlserver.com/VideoTutorials/Sql-Server-Tutorials/55/Series-5-videos-Stored-Procedures-An-Introduction-to.aspx
2/12/2008 12:33:09 PM EDT
[#45]
Holy son of a motherless whore... And what did I just find out? One of the sups here is a DBA on SQL 2000.. Im gonna let him handle the damn DB side of things. LOL!!

2/12/2008 12:37:12 PM EDT
[#46]

Quoted:

mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


mysql> show tables;
+------------------+
| Tables_in_joomla |
+------------------+
| test             |
+------------------+
1 row in set (0.00 sec)



Well looky there, im a lernin sumtin..

I think joomla has a php script that creates the tables it needs

mysql> show tables;
+-----------------------------+
| Tables_in_joomla            |
+-----------------------------+
| jos_banner                  |
| jos_bannerclient            |
| jos_bannertrack             |
| jos_categories              |
| jos_components              |
| jos_contact_details         |
| jos_content                 |
| jos_content_frontpage       |
| jos_content_rating          |
| jos_core_acl_aro            |
| jos_core_acl_aro_groups     |
| jos_core_acl_aro_sections   |
| jos_core_acl_groups_aro_map |
| jos_core_log_items          |
| jos_core_log_searches       |
| jos_groups                  |
| jos_menu                    |
| jos_menu_types              |
| jos_messages                |
| jos_messages_cfg            |
| jos_modules                 |
| jos_modules_menu            |
| jos_newsfeeds               |
| jos_plugins                 |
| jos_poll_data               |
| jos_poll_date               |
| jos_poll_menu               |
| jos_polls                   |
| jos_sections                |
| jos_session                 |
| jos_stats_agents            |
| jos_templates_menu          |
| jos_users                   |
| jos_weblinks    
2/12/2008 12:39:49 PM EDT
[#47]

Quoted:

Give me a place to start (book, website, anything).


Honestly, SQL Books Online is pretty good
www.microsoft.com/downloads/details.aspx?FamilyID=A6F79CB1-A420-445F-8A4B-BD77A7DA194B&displaylang=en

Assuming you know general SQL syntax, it's pretty much

CREATE PROCEDURE procedure name

(input variables)
@var1 var type,
@var2 var type,

AS

DECLARE
@var1 var type,
@var2 var type,

(bunch of TSQL)
GO

Use @ for the first char of variables, the ones above the AS are inputs, the declares are for use in the procedure.

I'll poke around for some sites a bit later

2/12/2008 12:44:09 PM EDT
[#48]

Quoted:

Quoted:

Give me a place to start (book, website, anything).


Honestly, SQL Books Online is pretty good
www.microsoft.com/downloads/details.aspx?FamilyID=A6F79CB1-A420-445F-8A4B-BD77A7DA194B&displaylang=en

Assuming you know general SQL syntax, it's pretty much

CREATE PROCEDURE procedure name

(input variables)
@var1 var type,
@var2 var type,

AS

DECLARE
@var1 var type,
@var2 var type,

(bunch of TSQL)
GO

Use @ for the first char of variables, the ones above the AS are inputs, the declares are for use in the procedure.

I'll poke around for some sites a bit later



Easy enough. Looks similar to a function, in any structured language. How do you return values? I see input variables, I see variables private to the procedure itself, but how do you return variables (for use in another application like Crystal, for example)?
2/12/2008 12:47:54 PM EDT
[#49]

Quoted:

Quoted:

mysql> use joomla
Database changed
mysql> show tables
   -> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'show
tables' at line 2
mysql>


mysql> show tables;
+------------------+
| Tables_in_joomla |
+------------------+
| test             |
+------------------+
1 row in set (0.00 sec)



Well looky there, im a lernin sumtin..

I think joomla has a php script that creates the tables it needs

mysql> show tables;
+-----------------------------+
| Tables_in_joomla            |
+-----------------------------+
| jos_banner                  |
| jos_bannerclient            |
| jos_bannertrack             |
| jos_categories              |
| jos_components              |
| jos_contact_details         |
| jos_content                 |
| jos_content_frontpage       |
| jos_content_rating          |
| jos_core_acl_aro            |
| jos_core_acl_aro_groups     |
| jos_core_acl_aro_sections   |
| jos_core_acl_groups_aro_map |
| jos_core_log_items          |
| jos_core_log_searches       |
| jos_groups                  |
| jos_menu                    |
| jos_menu_types              |
| jos_messages                |
| jos_messages_cfg            |
| jos_modules                 |
| jos_modules_menu            |
| jos_newsfeeds               |
| jos_plugins                 |
| jos_poll_data               |
| jos_poll_date               |
| jos_poll_menu               |
| jos_polls                   |
| jos_sections                |
| jos_session                 |
| jos_stats_agents            |
| jos_templates_menu          |
| jos_users                   |
| jos_weblinks    


Joomla cant even see mysql.. Cant connect to it..
2/12/2008 12:55:33 PM EDT
[#50]
I have some good stuff written using PERL plus MySQL. I used to HATE DBs but we have come to an understanding and now I <3 them.

Lately I've been writing network tools to spy on network users and log THINGS to MySQL

-Foxxz
Previous Page
/ 2
Next Page