Help!

Another stupid Ubuntu question

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions RSS
Next:  Bug#535367: sgml-base: Builds broken package from..  
Author Message
Zapanaz
External


Since: Jul 01, 2009
Posts: 1



PostPosted: Wed Jul 01, 2009 5:28 pm    Post subject: Another stupid Ubuntu question
Archived from groups: alt>slack, others (more info?)

All you guys are probably at X-day anyway but I guess this is worth a
shot.


I installed PHP using Synaptic. As part of the install, it installed
MySQL.

This is OK, I need MySQL anyway.

But I get access denied if I try to use MySQL as root or my user
account.

So I look at the MySQL files, and they are all owned by an account
called "mysql".

I look in "users and accounts", and there is no such account.

The MySQL process is running, mysqld.

So in the bash shell I enter

ps --User mysql

and it lists the mysqld process.

So, how exactly did this user which apparently doesn't exist start
this process?

I try to su to mysql in the bash shell, but nothing happens.

It shows me which account I'm currently using in the shell prompt,

joecosby@ubuntu or root@ubuntu

When I su to mysql, it doesn't give me an error message, but the
prompt doesn't change. When I try to use mysql, it denies access
again, and tells me I am either joecosby or root (so apparently su
just didn't do anything).

I changed the password for mysql so I have the correct password ...
but the account apparently doesn't exist.

In order to do anything with mysql, I am going to need to be able to
create user accounts.

I found a page that tells me how to change the MySQL root password,
but it requires I first log in as mysql.

But the account doesn't seem to exist, although it's running a
process.

Does anybody have any idea what this is all about, and how I can run a
process as this apparently non-existent account?

I'm tempted to try to uninstall and reinstall MySQL ... I am a Ubuntu
newby though. In Windows you go to add/remove programs, uninstall,
and reinstall. I don't know what the equivalent for Linux is.

I am worried that I will wind up with a mess on my hands, and possibly
break necessary dependencies in PHP.


hayulp.

Thanks for any help.

--
Zapanaz
International Satanic Conspiracy
Customer Support Specialist
http://joecosby.com/
When your spirit is not in the least clouded, when the clouds of bewilderment clear away, there is the true void.
- Miyamoto Musashi

:: Currently listening to Piano Sonata No.2 in B flat minor, op.36 I Allegro agitato, 1931, by Rachmaninov, from "24 Preludes"
Back to top
chessucat
External


Since: Jul 01, 2009
Posts: 1



PostPosted: Wed Jul 01, 2009 5:48 pm    Post subject: Re: Another stupid Ubuntu question [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
Back to top
Rev. 11D Meow!
External


Since: Jul 01, 2009
Posts: 1



PostPosted: Wed Jul 01, 2009 8:25 pm    Post subject: Re: Another stupid Ubuntu question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

http://store.nvidia.com/DRHM/servlet/ControllerServlet?Action=DisplayP...uctDeta
Back to top
David W. Hodgins
External


Since: Dec 04, 2005
Posts: 277



PostPosted: Wed Jul 01, 2009 10:09 pm    Post subject: Re: Another stupid Ubuntu question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 01 Jul 2009 20:28:19 -0400, wrote:

> I look in "users and accounts", and there is no such account.
> So, how exactly did this user which apparently doesn't exist start
> this process?
> I try to su to mysql in the bash shell, but nothing happens.

I see chessucat has already shown how to set the mysql root password.

I'm not familiar with debian, (I use Mandriva) but think I understand
the situation.

I gather "users and accounts" is a gui application that shows the
users that have been added to the system. Mandriva has such a tool
and one of it's default options, is to filter out system users. I
expect there's a similar option, in "users and accounts", that would
also allow the showing of system users.

In a terminal, as root, run "grep mysql /etc/passwd", and I expect
you will find the user is setup.

Another thing, is that user names in mysql may, or may not, have any
relation to linux userids, and even if they are using the same name,
they may have different passwords. The linux users are defined in
/etc/passwd, while the mysql users are defined in a mysql table.

On Mandriva systems, the mysql root password is set by running

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h $hostname password 'new-password'
or by running a script provided with the mysql rpm
/usr/bin/mysql_secure_installation
which sets the mysql root password, and optionally disables remote
root login, deletes the test database, and the anonymous user.

Once you've set the mysql root password, you may find a gui tool
like webmin, useful for administration of the mysql system.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
Back to top
Jerry Stuckle
External


Since: Aug 14, 2006
Posts: 4



PostPosted: Wed Jul 01, 2009 11:40 pm    Post subject: Re: Another stupid Ubuntu question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Rev. 11D Meow! wrote:
> http://www.iamaspammer.com

Go away, spammer!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex RemoveThis @attglobal.net
==================
Back to top
Vahis
External


Since: May 19, 2007
Posts: 79



PostPosted: Thu Jul 02, 2009 12:10 am    Post subject: Re: Another stupid Ubuntu question [Login to view extended thread Info.]
Archived from groups: alt>os>linux (more info?)

On 2009-07-02, Zapanaz <http> wrote:
>
> All you guys are probably at X-day anyway but I guess this is worth a
> shot.
>
>
> I installed PHP using Synaptic. As part of the install, it installed
> MySQL.
>
> This is OK, I need MySQL anyway.
>
> But I get access denied if I try to use MySQL as root or my user
> account.
>

You have already got great advise here and I'm not very skilled with
MySQL but I want to point out here one thing in particular:

System root (the real thing) and mysql root are not the same thing.
System Root is created during the initial installation of the system, mysql
root needs to be created separately. They have different powers.

They have the same name but they are different.
They can have the same password but I think they shouldn't. YMMV.

System users are not the same as mysql users. They can be, they can be
granted access. But by default they are not.

I'm posting this because this was a big headache for me some time ago
when I implemented MySQL.

The idea of two different roots was not explained anywhere for me to find,
it's not explained in any getting started tutorials or documentation that
I came across that time.

When I learned that system root and system users are one thing, mysql
root and mysql users are another thing I all became a lot cleare to me.

A system user can be also a mysql user but it doesn't have to be.
And there can be (usually there are) mysql users that do not have a
system user account. An example of this in my system is Amarok.

Vahis
--
"Sunrise 4:04am (EEST), sunset 10:43pm (EEST) at Espoo, Finland (18:39 hours daylight)"
http://waxborg.servepics.com
Linux 2.6.25.20-0.4-default #1 SMP 2009-06-01 09:57:12 +0200 x86_64
6:12am up 17 days 14:46, 15 users, load average: 0.11, 0.10, 0.05
Back to top
bb
External


Since: Jan 09, 2009
Posts: 16



PostPosted: Thu Jul 02, 2009 5:10 am    Post subject: Re: Another stupid Ubuntu question [Login to view extended thread Info.]
Archived from groups: alt>slack, others (more info?)

On 2009-07-02 04:09, David W. Hodgins wrote:
> On Wed, 01 Jul 2009 20:28:19 -0400, wrote:
>
>> I look in "users and accounts", and there is no such account.
>> So, how exactly did this user which apparently doesn't exist start
>> this process?
>> I try to su to mysql in the bash shell, but nothing happens.
>
> I see chessucat has already shown how to set the mysql root password.
>
> I'm not familiar with debian, (I use Mandriva) but think I understand
> the situation.
>
> I gather "users and accounts" is a gui application that shows the
> users that have been added to the system. Mandriva has such a tool
> and one of it's default options, is to filter out system users. I
> expect there's a similar option, in "users and accounts", that would
> also allow the showing of system users.
>
> In a terminal, as root, run "grep mysql /etc/passwd", and I expect
> you will find the user is setup.
>
> Another thing, is that user names in mysql may, or may not, have any
> relation to linux userids, and even if they are using the same name,
> they may have different passwords. The linux users are defined in
> /etc/passwd, while the mysql users are defined in a mysql table.
>
> On Mandriva systems, the mysql root password is set by running
>
> /usr/bin/mysqladmin -u root password 'new-password'
> /usr/bin/mysqladmin -u root -h $hostname password 'new-password'
> or by running a script provided with the mysql rpm
> /usr/bin/mysql_secure_installation
> which sets the mysql root password, and optionally disables remote
> root login, deletes the test database, and the anonymous user.
>
> Once you've set the mysql root password, you may find a gui tool
> like webmin, useful for administration of the mysql system.
>
> Regards, Dave Hodgins
>

Yes, and if someone think it's a pain to always add -u root -p to all
mysql commands, and enter password every time.
One can create the file /root/.my.cnf , chmod it to 600 and then add:
[client]
host = localhost
user = root
password = 'the password'

After that things like mysql, mysqlshow , mysqladmin works without
password unless $HOME still is set to the user due to su instead of su -.

This is good for batch jobs doing sql stuff.
Or shell scripts that get some values from a database, example
# Files=$(echo 'select count(*) from File' | mysql -r --skip-column-names bacula)
# echo $Files
6967219

Or things like:

# echo 'select count(*) as Files from File' | mysql -X bacula
<?xml version="1.0"?>

<resultset statement="select count(*) as Files from File
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="Files">6967219</field>
</row>
</resultset>

/bb
Back to top
Anonology
External


Since: Jul 02, 2009
Posts: 1



PostPosted: Thu Jul 02, 2009 6:57 am    Post subject: Re: Another stupid Ubuntu question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jul 1, 8:28 pm, Zapanaz <http://joecosby.com/code/mail.pl?
f... DeleteThis @mindspring.com> wrote:

> I try to su to mysql in the bash shell, but nothing happens.


You need to su in FEDERAL court if you really want results...
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum