Re: Need Help setting up Mysql on Openserver 6.0
From: Steve M. Fabac, Jr. (smfabac_at_att.net)
Date: 11/18/05
- Next message: Steve M. Fabac, Jr.: "Re: Need Help setting up Mysql on Openserver 6.0"
- Previous message: Bill Vermillion: "Re: Need Help setting up Mysql on Openserver 6.0"
- In reply to: Boyd Lynn Gerber: "Re: Need Help setting up Mysql on Openserver 6.0"
- Next in thread: Steve M. Fabac, Jr.: "Re: Need Help setting up Mysql on Openserver 6.0"
- Reply: Steve M. Fabac, Jr.: "Re: Need Help setting up Mysql on Openserver 6.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Nov 2005 22:39:40 GMT
Boyd Lynn Gerber wrote:
>
> On Fri, 18 Nov 2005, Steve M. Fabac, Jr. wrote:
> > >Boyd Lynn Gerber wrote:
> >
> > Thanks for that offer. But, I want to evaluate SCO's Openserver 6.0 distribution
> > "out of the box" to see if it is of any value. If they are going to distribute
> > Mysql with the OS, then they should provide instructions for the "non-wizard"
> > on how to get started with the program.
> > > Read ...
> > > http://dev.mysql.com/doc/refman/5.0/en/installing-binary.html
> > > http://dev.mysql.com/doc/refman/5.0/en/mysql-binaries.html
> >
> > Essentially the same as included with the SCO Doc server.
>
> I always prefer more information. Please read A.4.1. How to Reset
> the Root Password...
>
> http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
>
Boyd,
The pertinent section of the above is:
shell> kill `cat /mysql-data-directory/host_name.pid`
Note the use of backticks rather than forward quotes with the
cat command; these cause the output of cat to be substituted into the
kill command.
3.Create a text file and place the following command within it on a single line:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
Save the file with any name. For this example the file will be ~/mysql-init.
4.Restart the MySQL server with the special --init-file=~/mysql-init option:
shell> mysqld_safe --init-file=~/mysql-init &
The contents of the init-file are executed at server startup, changing
the root password. After the server has started successfully you should
delete ~/mysql-init.
What I did:
Created /tmp/mysql-init with the single line:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('29$bob31');
# /etc/init.d/mysql stop
Stopping mysql ... Wait for mysqld to exit..done.
# ps -ef | grep mysql
root 3368 1 0 Nov-17 ? 00:00:00 mysqlmanager
root 7105 6735 0 15:58:40 ttyp1 00:00:00 grep mysql
root 3267 1 0 Nov-17 ? 00:00:00 mysqlmanager
# cat /tmp/mysql-init
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('29$bob31');
# ls -l /tmp/mysql-init
-rw-r--r-- 1 root sys 60 Nov 18 15:39 /tmp/mysql-init
# mysqld_safe --init-file=/tmp/mysql-init &
[1] 7110
# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/unix.smfabac.com.pid
051118 16:00:36 mysqld ended
[1] + Done mysqld_safe --init-file=/tmp/mysql-init &
# ps -ef | grep mysql
root 3368 1 0 Nov-17 ? 00:00:00 mysqlmanager
root 3267 1 0 Nov-17 ? 00:00:00 mysqlmanager
#
So mysqld is not running.
# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib
/mysql/mysql.sock' (2)
# /etc/init.d/mysql start
Starting mysql ... done.
# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y
ES)
#
AND per the suggestion of "JP" piperent@XXXXXXX private e-mail response
> For SQLYog, I have been able to log in using a blank (and when I say blank,
> I mean blank - nothing, nada, zip) to complete the connection. In the
> password box, use the delete key to clear the input text box rather than a
> spacebar. It works great for my purposes.
>
> I would probably recommend setting up a password if your going to be using
> this in a functional business environment, but if your just trying to
> connect, blank it out and see what it does.
>
I tried SQLYog and just as JP suggested blanking the "password" field allows me
to login to Mysql running on the Openserver 6.0 system.
Even after executing the steps above, i.e. mysqld_safe --init-file=/tmp/mysql-ini
the "root" password is still blank (SQLYog with blank password connects).
I tried modifying /etc/init.d/mysql as bellow:
if test -d $datadir; then
if test -x $bindir/mysqld_safe
then
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
dspmsg $CAT 3 "Starting %s ... " $MYSQL_LABEL
$bindir/mysqld_safe --datadir=$datadir \
--pid-file=$pid_file \
--init-file=/tmp/mysql-init >/dev/null 2>&1 &
if test -w /var/lock/subsys
then
touch /var/lock/subsys/mysql
fi
Then:
# /etc/init.d/mysql stop
Stopping mysql ... Wait for mysqld to exit.done.
# sh -x /etc/init.d/mysql start > /tmp/log 2>&1
# cat /tmp/log
basedir=
MYSQLDIR=/usr/mysql
+ test -e /etc/default/mysql
+ . /etc/default/mysql
+ test -z
+ test -e /tcb/files/auth/m/mysql
MYSQLUSER=mysql
+ test -z
MYSQLDATA=/usr/mysql/data
+ test -z
MYSQLSTARTOPTS=
+ test -n
USAGE=Usage: %s [ start | stop | enable | disable | query | status | restart ]
CAT=mysql.cat
MYSQLPIDFILE=/usr/mysql/data/mysqld.pid
SCRIPTDIR=/etc/init.d
SCRIPT=mysql
MYSQL_LABEL=mysql
SCRIPTNUM=89
TRUE=0
FALSE=1
datadir=/usr/mysql/data
pid_file=/usr/mysql/data/mysqld.pid
+ test -z
basedir=/
bindir=/usr/bin
PATH=/sbin:/usr/sbin:/bin:/usr/bin://bin:/usr/gnu/bin
+ export PATH
mode=start
+ echo testing\c
+ echo -n testing
echo_c=\c echo_n=
+ test -x ./bin/my_print_defaults
print_defaults=./bin/my_print_defaults
extra_args=
+ test /usr/mysql/data != /var/lib/mysql
extra_args=-e /usr/mysql/data/my.cnf
+ ./bin/my_print_defaults -e /usr/mysql/data/my.cnf mysqld mysql_server mysql.server
+ parse_arguments
+ test -z /usr/mysql/data/mysqld.pid
+ cd /
+ mysql_start
+ server_running
+ get_server_pid
+ test -r /usr/mysql/data/mysqld.pid
+ return 0
kill_pid=0
+ [ 0 -ne 0 ]
+ return 1
+ rm -f /usr/mysql/data/mysqld.pid
+ test -d /usr/mysql/data
+ test -x /usr/bin/mysqld_safe
+ dspmsg mysql.cat 3 Starting %s ... mysql
Starting mysql ... + test -w /var/lock/subsys
+ dspmsg mysql.cat 4 done.\n
done.
+ exit 0
> I edited the line below to wrap at "\" (added)
> + /usr/bin/mysqld_safe --datadir=/usr/mysql/data \
--pid-file=/usr/mysql/data/mysqld.pid --init-file=/tmp/mysql-init
#
So /etc/init.d/mysql start executed mysqld_safe and added the
--init-file=/tmp/mysql-init But...
# ps -ef | grep mysql
root 3368 1 0 Nov-17 ? 00:00:00 mysqlmanager
root 3267 1 0 Nov-17 ? 00:00:00 mysqlmanager
mysql 7256 7233 0 16:16:09 ttyp1 00:00:02 /usr/sbin/mysqld --basedi
r=/ --datadir=/usr/mysql/data --user=mysql --pid-file=
root 7283 6735 0 16:25:48 ttyp1 00:00:00 grep mysql
root 7233 1 0 16:16:09 ttyp1 00:00:00 /usr/bin/mysqld_safe --da
tadir=/usr/mysql/data --pid-file=/usr/mysql/data/mysql
#
And
# mysql -u root -p -h localhost
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y
ES)
#
And SQLYog still connects with a blank password for user root.
What next?
> and to start Section 2.9.3 "Securing the Initial MySQL Accounts...
>
> http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html
The pertinent section of the above is:
To use SET PASSWORD on Unix, do this:
shell> mysql -u root
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR ''@'host_name' = PASSWORD('newpwd');
In the second SET PASSWORD statement, replace host_name with the name of the
server host. This is the name that is specified in the Host column of the
non-localhost record for root in the user table. If you don't know what
hostname this is, issue the following statement before using SET PASSWORD:
mysql> SELECT Host, User FROM mysql.user;
Look for the record that has root in the User column and something other
than localhost in the Host column. Then use that Host value in the second
SET PASSWORD statement.
The other way to assign passwords to the anonymous accounts is by using
UPDATE to modify the user table directly. Connect to the server as root
and issue an UPDATE statement that assigns a value to the Password
column of the appropriate user table records. The procedure is the same
for Windows and Unix. The following UPDATE statement assigns a password
to both anonymous accounts at once:
shell> mysql -u root
mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd')
-> WHERE User = '';
mysql> FLUSH PRIVILEGES;
Boyd,
My problem with the above is that it assumes that I can execute
the command mysql -u root but since, I can't it is not the solution.
>
> > Too much information, What the index needs is "stupid users start here"
> > and then numbered steps in sequence with the commands to get the
> > system working.
> >
> > So, Okay, its running.
> >
> > but wait!! Watch this!
>
> This all shows it is running and that some on has set it up to change
> permissions see the first reference above. I recommend the second link
> when setting up mysql.
>
> --
> Boyd Gerber <gerberb@zenez.com>
> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047
--
Steve Fabac
S.M. Fabac & Associates
816/765-1670
- Next message: Steve M. Fabac, Jr.: "Re: Need Help setting up Mysql on Openserver 6.0"
- Previous message: Bill Vermillion: "Re: Need Help setting up Mysql on Openserver 6.0"
- In reply to: Boyd Lynn Gerber: "Re: Need Help setting up Mysql on Openserver 6.0"
- Next in thread: Steve M. Fabac, Jr.: "Re: Need Help setting up Mysql on Openserver 6.0"
- Reply: Steve M. Fabac, Jr.: "Re: Need Help setting up Mysql on Openserver 6.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|