Installing MySQL

Ask questions regarding Gentoox, Gentoo and Linux in general in these forums and we'll do our best to help you!
trixter
Adept
Posts: 65
Joined: Thu Sep 25, 2003 7:25 pm

Installing MySQL

Post by trixter »

I have already successfully installed the apache webserve and php using the command shown in Shallax's tutorial.

emerge apache mod_php php

Now I want to install MySQL. Is there any trick to doing this or can I just do an:

emerge mysql

to get it? Thanks.
nobspangle
Gentoox Guru!
Posts: 1681
Joined: Sun Sep 28, 2003 11:59 am
Location: Manchester, UK

Post by nobspangle »

Emerge mysql will work fine then run
rc-update add mysql default && /etc/init.d/mysql start

I think you may have to do something else to install the default database but if that is the case there will be a message somewhere.
If you keep an open mind, will your brain fall out?
xstaci
Newbie
Posts: 2
Joined: Thu Dec 18, 2003 5:25 am

Post by xstaci »

at least with the pc gentoo running the Init script the first time should isntall those tables, otherwise i think a "find * / | grep "mysql*install*" should list something like mysql_install_tables,

remember u gotta be root!
kennelbound
Linux User
Posts: 12
Joined: Fri Jan 16, 2004 7:14 am

Post by kennelbound »

Immediately after the emerge type the following:

Code: Select all

/usr/bin/mysql_install_db
This adds the default database.
nobspangle
Gentoox Guru!
Posts: 1681
Joined: Sun Sep 28, 2003 11:59 am
Location: Manchester, UK

Post by nobspangle »

you can just type mysql_install_db as /usr/bin is in your path
If you keep an open mind, will your brain fall out?
Trogdor
Gentoox Guru!
Posts: 553
Joined: Tue Oct 07, 2003 9:57 pm
Location: MOUNT TAPE U1439 ON B3, NO RING

Post by Trogdor »

If it doesn't work, BE SURE TO RUN THE INSTALLATION SCRIPT that it gives you during the emerge.
MOUNT TAPE U1439 ON B3, NO RING

Q: HOW DO I RUN MAGIC ??
A: You run magic by not typing in capital letters.
tamz273
Newbie
Posts: 7
Joined: Tue Jan 06, 2004 12:54 pm

Post by tamz273 »

ok i followed wat u guys told us to do, i ran the mysql_install_db
it setup the tables for me and then asked to change the root password, i tried to but i kept getting errors :S

and shouldnt there be some sort of GUI to setup all the rest of the tables and that stuff???
tamz273
Newbie
Posts: 7
Joined: Tue Jan 06, 2004 12:54 pm

Post by tamz273 »

and wenever i try to do any admin commands, i get an error stating:
mysqladmin: connecto to server at 'localhost' failed
error: 'Acess denied for user: 'root@localhost' (using password:NO)

any1 help?
nobspangle
Gentoox Guru!
Posts: 1681
Joined: Sun Sep 28, 2003 11:59 am
Location: Manchester, UK

Post by nobspangle »

you need to add the -p switch to the mysqladmin and mysql commands to make it prompt you for a password. Like this

Code: Select all

mysql -p 
or

Code: Select all

mysqladmin -p
Then enter your mysql root password and you are away.

I don't know about a gui client I always make dump files and create tables that way.

The mysql website is the best place for info, the manual is very detailed and explains everything you need to know
If you keep an open mind, will your brain fall out?
tamz273
Newbie
Posts: 7
Joined: Tue Jan 06, 2004 12:54 pm

Post by tamz273 »

i did it for the mysql and it was fine, but wen i tried for the mysqladmin, i got a list of commands i can use with it, and wen i try any of them, i end up with the same error, localhost bla bla bla


help?
nobspangle
Gentoox Guru!
Posts: 1681
Joined: Sun Sep 28, 2003 11:59 am
Location: Manchester, UK

Post by nobspangle »

as long as you use the -p flag it should work e.g if you want to create a database called newdb the command would be

Code: Select all

mysqladmin create newdb
You need to add a -p flag and maybe also -u and -h

Code: Select all

mysqladmin -u root -h localhost create newdb -p
you should then be prompted for the root@localhost password

If you can't get this to work forget about using mysqladmin and just use the mysql client which can do all the same stuff
If you keep an open mind, will your brain fall out?
tamz273
Newbie
Posts: 7
Joined: Tue Jan 06, 2004 12:54 pm

Post by tamz273 »

ok thx!!
it prompted a password, i entered it, and it created it i believe, but now, what are the username and password of THAT table when iw anna install a phpBB board or sumthing??
nobspangle
Gentoox Guru!
Posts: 1681
Joined: Sun Sep 28, 2003 11:59 am
Location: Manchester, UK

Post by nobspangle »

You need to do some reading on the mysql site.
What you have created is a database (not a table) tables exist inside databases. A mysql server can host several databases all with several tables.
You can just use the root username and password or you can create new users using the GRANT command.
If you keep an open mind, will your brain fall out?
Trogdor
Gentoox Guru!
Posts: 553
Joined: Tue Oct 07, 2003 9:57 pm
Location: MOUNT TAPE U1439 ON B3, NO RING

Post by Trogdor »

Since MySQL is a relational database, you have >=1 table per db. Like this:

Code: Select all

+===============================+
| ------- A Database -----------|
+===============================+
|----+=====================+----|
|----| A table ------------|----|
|----+=====================+----|
|-------------------------------|
|----+=====================+----|
|----| Another Table ------|----|
|----+=====================+----|
|-------------------------------|
+===============================+
MOUNT TAPE U1439 ON B3, NO RING

Q: HOW DO I RUN MAGIC ??
A: You run magic by not typing in capital letters.
tamz273
Newbie
Posts: 7
Joined: Tue Jan 06, 2004 12:54 pm

Post by tamz273 »

i read all of the chapters for setting up a table, yet i dunno what the table for a forum or phpnuke or a gallery should contain...

it duznt specify about forums... so wat can i do?

is there a step-by-step guide of how to setup tables that work with phpBB, phpnuke, and/or gallery4???
Post Reply