
Non root user MySQL install possible?
Hi. Before asking my question I would like to state that I have looked
through the installation documentation, and have also successfully
performed MySQL installations on WindowsXP (along with Apache and
PHP), as well as on Linux machines that I have administrative (root)
access on. However, I am having problems installing MySQL on a Linux
machine as a non root user. My question is: is it possible? I don't
see why it wouldn't be, but after fighting with setting the correct
paths in mysql.server, and making sure ~/.my.cnf looked right, I am
having doubts. Rather than list every error I ran into, I will simply
state that I had problems setting up the proper paths (such as not
being able to alter /var/run/mysql/mysql.pid, which obviously cannot
be done while not root).
If it is possible to do a local install as a non privileged user, can
someone please point me in the right direction, to a guide or
something? Or, simply state which config files need to be edited
(~/.my.cnf, mysql.server, etc) and I will work from there. Google
hasn't helped much/I am not using the right search terms. Thank you.
Also - if it helps, I am trying to install both the client and the
server so I can access the MySQL database via Apache/PHP. The client
should already be set to go, it is getting the server up and running
that I am having problems with. Thanks again.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
RE: Non root user MySQL install possible?
> -----Original Message-----
> From: j [mailto:reachjeff [at] gmail.com]
> Sent: dinsdag 1 februari 2005 10:09
> To: mysql [at] lists.mysql.com
> Subject: Non root user MySQL install possible?
>
> Hi. Before asking my question I would like to state that I have looked
> through the installation documentation, and have also successfully
> performed MySQL installations on WindowsXP (along with Apache and
> PHP), as well as on Linux machines that I have administrative (root)
> access on. However, I am having problems installing MySQL on a Linux
> machine as a non root user. My question is: is it possible? I don't
> see why it wouldn't be, but after fighting with setting the correct
> paths in mysql.server, and making sure ~/.my.cnf looked right, I am
> having doubts. Rather than list every error I ran into, I will simply
> state that I had problems setting up the proper paths (such as not
> being able to alter /var/run/mysql/mysql.pid, which obviously cannot
> be done while not root).
>
> If it is possible to do a local install as a non privileged user, can
> someone please point me in the right direction, to a guide or
> something? Or, simply state which config files need to be edited
> (~/.my.cnf, mysql.server, etc) and I will work from there.
My first reaction was: I have never even heard of MySQL running as root!
and I am sticking with that. :) Seriously, you should never run MySQL as
root. Create a user, say, mysql, chown mysql:mysql /var/db/mysql/* (or
wherever your databases reside), chmod go-rwx /var/db/mysql/*, add "user =
mysql" to your my.cnf, and you're pretty much done.
Granted, you cannot have your pid in /var/run/ directly. So? Create a
subdir under /var/run/, owned by the mysql user, and have the pid in
there.
- Mark
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
Re: Non root user MySQL install possible?
Sorry, I don't mean running MySQL as root, I mean I do not have root
access on the server I am trying to install MySQL on - for myself,
under my home directory. I run into permission problems (because I am
not root, I can't alter anything under /var). I am trying to edit the
necessary configs so the paths point to /home/me but that is where I
am running into problems. What I'm looking for is a guide, or a list
of config files that need to be edited. Thanks.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
RE: Non root user MySQL install possible?
> -----Original Message-----
> From: j [mailto:reachjeff [at] gmail.com]
> Sent: dinsdag 1 februari 2005 11:20
> To: Mark
> Cc: mysql [at] lists.mysql.com
> Subject: Re: Non root user MySQL install possible?
>
> Sorry, I don't mean running MySQL as root, I mean I do not have root
> access on the server I am trying to install MySQL on - for myself,
> under my home directory.
Ok, gotcha.
> I run into permission problems (because I am
> not root, I can't alter anything under /var). I am trying to edit the
> necessary configs so the paths point to /home/me but that is where I
> am running into problems. What I'm looking for is a guide, or a list
> of config files that need to be edited. Thanks.
Hmm, I do not think it will be possible for you to actually compile MySQL
this way; for it will undoubtledly want to install libraries, etc, in
/usr/local/lib/ and such. But you can always just download a precompiled
package from the MySQL download site, untar it, and run the binary
straight from your home dir. :)
The server you are doing this on may already have a MySQL server
running. So, you would have to use something different from port 3306,
or /tmp/mysql.sock, or /var/db/mysql/. But all of that is configurable.
- Mark
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
Re: Non root user MySQL install possible?
Hello.
> If it is possible to do a local install as a non privileged user, can
> someone please point me in the right direction, to a guide or
> something?
Yes it is possible. Here is a part of my configuration file.
[client]
port = 3718
socket = /home/gleb/mysqls/tmp/mysql.sock.gleb.a
[mysqld]
log_warnings=1
set-variable=user=gleb
default_character_set=utf8
port = 3718
socket = /home/gleb/mysqls/tmp/mysql.sock.gleb.a
skip-locking
pid-file = /home/gleb/mysqls/tmp/mysql.pid.gleb.a
log = /home/gleb/mysqls/logs/mysql.log.a
log-bin = /home/gleb/mysqls/logs/mysql.log-bin.a
log-update = /home/gleb/mysqls/logs/mysql.log-update.a
log-error = /home/gleb/mysqls/logs/mysql.log-error.a
log-isam = /home/gleb/mysqls/logs/mysql.log-isam.a
datadir =/home/gleb/mysqls/mysql-debug-4.1.9-pc-linux-gnu-i686/data
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
wait_timeout=1000
interactive_timeout=50
server-id = 1
innodb_data_home_dir=/home/gleb/mysqls/mysql-debug-4.1.9-pc- linux-gnu-i686/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir =/home/gleb/mysqls/mysql-debug-4.1.9-pc-linux-gnu-i686/data
innodb_log_arch_dir =/home/gleb/mysqls/mysql-debug-4.1.9-pc-linux-gnu-i686/data
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
j <reachjeff [at] gmail.com> wrote:
> Hi. Before asking my question I would like to state that I have looked
> through the installation documentation, and have also successfully
> performed MySQL installations on WindowsXP (along with Apache and
> PHP), as well as on Linux machines that I have administrative (root)
> access on. However, I am having problems installing MySQL on a Linux
> machine as a non root user. My question is: is it possible? I don't
> see why it wouldn't be, but after fighting with setting the correct
> paths in mysql.server, and making sure ~/.my.cnf looked right, I am
> having doubts. Rather than list every error I ran into, I will simply
> state that I had problems setting up the proper paths (such as not
> being able to alter /var/run/mysql/mysql.pid, which obviously cannot
> be done while not root).
>
> If it is possible to do a local install as a non privileged user, can
> someone please point me in the right direction, to a guide or
> something? Or, simply state which config files need to be edited
> (~/.my.cnf, mysql.server, etc) and I will work from there. Google
> hasn't helped much/I am not using the right search terms. Thank you.
>
> Also - if it helps, I am trying to install both the client and the
> server so I can access the MySQL database via Apache/PHP. The client
> should already be set to go, it is getting the server up and running
> that I am having problems with. Thanks again.
>
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__ Gleb.Paharenko [at] ensita.net
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET
<___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
SELECT on string field
Hi,
I've a field with
www.s.com/p.php?id=3
www.s.com/p.php?id=4
www.s.com/p.php?id=5
if a do a query with the atribute 'group by' i want that the system regroup
all that is after the '?'
is that possible?
SELECT field WHERE all that is after the '?' GROUP BY all that is after the
'?'
the result should be:
www.s.com/p.php
thanks
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
RE: SELECT on string field
[snip]
I've a field with
www.s.com/p.php?id=3D3
www.s.com/p.php?id=3D4
www.s.com/p.php?id=3D5
if a do a query with the atribute 'group by' i want that the system
regroup
all that is after the '?'
is that possible?
SELECT field WHERE all that is after the '?' GROUP BY all that is after
the
'?'
the result should be:
www.s.com/p.php
[/snip]
SELECT substring(field, 1, 15) FROM table WHERE substring(field, 16) =3D
'?' GROUP BY field
should return what you have asked for above (www.s.com/p.php). However,
if you group by each thing that is after the '?' your result set would
be
www.s.com/p.php (this group is id=3D3)
www.s.com/p.php (this group is id=3D4)
www.s.com/p.php (this group is id=3D5)
You can also try
SELECT substring(field, 1, locate('?', field)-1) FROM table GROUP BY
substring(field, locate('?', field));
http://dev.mysql.com/doc/mysql/en/string-comparison-function s.html
http://dev.mysql.com/doc/mysql/en/string-functions.html
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql [at] m.gmane.org
Re: SELECT on string field
Hi Arcangelo!
Try this:
SELECT COUNT(*), url, SUBSTRING_INDEX(url, "?", 1) AS page_name
FROM sites
GROUP BY page_name
SUBSTRING_INDEX will return the leftmost (or rightmost) part of a string
before the ocurrence of a delimiter ("?" in this case. See Documentation:
Chapter "String Functions"). The trick here is to GROUP BY the result of
this operation.
Note that you could elaborate this further so that you could GROUP by
the host name. You will need to anidate SUBSTRING_INDEX calls so that you
end up with the desired data.
For example:
SELECT COUNT(*), url, SUBSTRING_INDEX(SUBSTRING_INDEX(url, "?", 1),
"/", 1) AS host_name
FROM sites
GROUP BY host_name
This will group together the following URIs as one:
- www.domain.com/pageone.php (There is no ?)
- www.domain.com?id=2 (There is no /)
Beware though, this usage will not use indexes on "url" column so be
careful and do not use this on big tables. You will need to use more
elaborated techniques to speed up query times on big tables.
Cheers,
Jose Miguel.
>----- ORIGINAL MESSAGE -----------
> I've a field with
>
> www.s.com/p.php?id=3
> www.s.com/p.php?id=4
> www.s.com/p.php?id=5
>
>
> if a do a query with the atribute 'group by' i want that the system
regroup
> all that is after the '?'
> is that possible?
>
> SELECT field WHERE all that is after the '?' GROUP BY all that is after
the
> '?'
> the result should be:
>
> www.s.com/p.php
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org