17452 Posts in 4473 Topics by 1971 members
|Go to End|
23 February 2007 at 12:36pm Last edited: 23 February 2007 12:39pm
I have two versions of MySQL running on the same machine
Question 1: I have NOT changed my php.ini to reflect any changes, is this necessary?
I am booting using the --old-passwords to remain compatable with the MySQL4 client with a user named mysql5
$ sudo /var/mysql5/bin/mysqld_safe --old-passwords --user=mysql5 &
I am interested in a liberal policy to get SilverStripe installed before I want to deal with security issues. The following outlines what I have done for a test installation. The following reflects the minimum permission settings required to get me past all the portions of the install.php (except the database details).
I have an OpenBSD machine running
Apache/1.3.29 (Unix) PHP/5.0.4 mod_ssl/2.8.16 OpenSSL/0.9.7g
with MySQL 4.0.24 and MySQL 5.0.27
I have created and altered the /etc/my.cnf file to use port 3666 for MySQL 5 and ensured that the file my.cnf is owned by mysql5
chown mysql5 my.cnf
# The MySQL client
port = 3666
socket = /tmp/mysql.sock
# The MySQL server
port = 3666
socket = /tmp/mysql.sock
// I have liberal folder permission settings
//Get a copy of silverstripe-v2.0.0.tar.gz onto your server and extract it
$tar zxvf silverstripe-v2.0.0.tar.gz
//Change the ownership to the username that owns htdocs.
#chown -R username silverstripe-v2.0.0
//Make the folder 'silverstripe-v18.104.22.168' global read /write /execute
#chmod 777 silverstripe-v2.0
//Make the folder 'silverstripe-v22.214.171.124/mysite' global read /write
#chmod 776 silverstripe-v126.96.36.199/mysite
Create a temporary directory named adfadsfdas
# mkdir adfadsfdas
//change ownership to your silverstripe user
# chown username adfadsfdas
//Make the temporary folder global read /write/ execute
# chmod 777 adfadsfdas
//Create a MySQL User and Database
I have created a new MySQL5 root powered user and a database using the following
MySQL>GRANT USAGE ON * . * TO 'StripeUSER2'@'localhost' IDENTIFIED BY 'password' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ;
// give StripeUSER2 access to all databases
mysql> GRANT ALL PRIVILEGES ON *.* TO 'StripeUSER2'@'localhost'
-> IDENTIFIED BY 'passwordheret' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
// redundant give privilege to StripeDATA2 to StripeUSER2
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON StripeDATA2.*
-> TO 'StripeUSER2'@'localhost'
-> IDENTIFIED BY 'anarchy4breakfast';
Query OK, 0 rows affected (0.01 sec)
// Then with the data entered into install.php for the database as:
// the following messages appear
Does the server exist OK (localhost:3666)
Are the access credentials correct
That username/password doesn't work: Access denied for user: 'StripeUSER2@localhost' (Using password: YES)
Can I access/create the database
I can't create new databases and the database 'StripeDATA2' doesn't exist (user 'StripeUSER2' doesn't have CREATE DATABASE permissions.)
Where am I going wrong? Wrong method of accessing non-standard port?
unknown php.ini setting for non-standard port? What am I not seeing?
23 February 2007 at 9:33pm
"What am I doing wrong"? Good question, looks like all is being done properly.
Have you confirmed that if you do things like;
mysql -uStripeUSER2 -panarchy4breakfast -P 3666 StripeDATA2;
To test you can get it, and do basic SQL commands?
One other question; you have
MySQL>GRANT USAGE ON * . * TO 'StripeUSER2'@'localhost' IDENTIFIED BY 'password' ....
mysql> GRANT ALL PRIVILEGES ON *.* TO 'StripeUSER2'@'localhost' -> IDENTIFIED BY 'passwordheret' ....
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP -> ON StripeDATA2.* -> TO 'StripeUSER2'@'localhost' -> IDENTIFIED BY 'anarchy4breakfast';
Each time you got a different password being set by IDENTIFIED... I am not sure why this is, but I'm wondering if you just have set the password to something you're not using to connect with in SilverStripe?
24 February 2007 at 8:51am
$mysql -u StripeUSER2 -p -P 3666
mysql Ver 12.22 Distrib 4.0.24, for unknown-openbsd3.8 (i386)
Connection id: 1
Current user: StripeUSER2@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Server version: 5.0.33-log
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /tmp/mysql.sock
Uptime: 20 hours 35 min 40 sec
This seems to show the connection client as 4.0.24 and the server as 5.0.33-log
24 February 2007 at 9:12am
I took your advice and tried to manipulate the StripeDATA2 database and produced a MySQL error. Excellent. I have a new error to chase down... a lead.
mysql> use StripeDATA2;
mysql> SHOW TABLES;
ERROR 1018: Can't read dir of './StripeDATA2/' (errno: 13)
mysql> CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20),
-> species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
ERROR 1005: Can't create table 'pet' (errno: 13)
26 February 2007 at 2:55pm
Cool, looks like you definately have filesystem or MySQL permission problems to figure out before SilverStripe can add tables and do the other things it wants.
|Go to Top|