...
Edited /opt/mysql/current/bin/mysqld_safe
to move all links to /opt/mysql/current/
rather than /usr/local/mysql
.
Tried to start server again:
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current/bin]$ sudo ./e
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
060830 11:03:17 mysqld ended
|
Somethings gone wrong.
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current/bin]$ sudo -s
[root@net-desk1 bin]# cat /var/lib/mysql/
ibdata1 ib_logfile1 net-desk1.slac.stanford.edu.err
ib_logfile0 mysql.sock
[root@net-desk1 bin]# cat /var/lib/mysql/net-desk1.slac.stanford.edu.err
060830 11:03:15 mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
060830 11:03:15 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
060830 11:03:16 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
060830 11:03:16 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
060830 11:03:17 InnoDB: Started; log sequence number 0 0
060830 11:03:17 [ERROR] /opt/mysql/current/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
060830 11:03:17 [ERROR] Can't start server: can't create PID file: No such file or directory
060830 11:03:17 mysqld ended
|
Looks like it can't create the pid file in the mysqld directory - so created it manually:
Code Block |
---|
[root@net-desk1 bin]# cd /var/run/
[root@net-desk1 run]# mkdir mysqld
|
Tried to restart the server; same thing - log says:
Code Block |
---|
060830 11:06:10 mysqld started
060830 11:06:10 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
060830 11:06:10 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
060830 11:06:10 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
060830 11:06:10 InnoDB: Started; log sequence number 0 43655
060830 11:06:10 [ERROR] /opt/mysql/current/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
060830 11:06:10 [ERROR] Can't start server: can't create PID file: Permission denied
060830 11:06:10 mysqld ended
|
Make sure all permissions are set:
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current/bin]$ sudo chown -R mysql:mysql \
/var/lib/mysql/ \
/opt/mysql/current \
/var/run/mysqld
|
Ran the configuration for MySQL:
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current]$ sudo -s
[root@net-desk1 current]# scripts/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h net-desk1.slac.stanford.edu password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
|
And started the daemon:
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current/bin]$ sudo ./mysqld_safe --user=mysql
Starting mysqld daemon with databases from /var/lib/mysql
|
- assumed the previous errors were due to permission conflicts.
Connect to MySQL DB through the new socket, as the configuration appears to point to a socket file which doesn't exist:
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current/bin]$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
|
Need to make sure we can access the socket file located in /var/lib/mysql
Code Block |
---|
[root@net-desk1 mysql]# pwd
/var/lib/mysql
[root@net-desk1 mysql]# chmod o+x .
|
Finally:
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current/bin]$ mysql --socket=/var/lib/mysql/mysql.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.24-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
|
Make sure we set the root passwords:
Code Block |
---|
[ytl@net-desk1:/opt/mysql/current/bin]$ ./mysqladmin --socket=/var/lib/mysql/mysql.sock -u root password '#######'
[ytl@net-desk1:/opt/mysql/current/bin]$ ./mysqladmin --socket=/var/lib/mysql/mysql.sock -u root -h net-desk1.slac.stanford.edu password '########'
|
Lets initiate the SQL MA databases from the SQL file mysql-sqlma-dbsetup.sql
Code Block |
---|
[ytl@net-desk1:/opt/perfSONAR]$ mysql --socket=/var/lib/mysql/mysql.sock -u root -p < mysql-sqlma-dbsetup.sql
Enter password:
|
This results in the following tables being created:
Code Block |
---|
mysql> use perfsonar_ma;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+------------------------+
| Tables_in_perfsonar_ma |
+------------------------+
| domain_link |
| interdomain_link |
| perfsonar_utilization |
+------------------------+
3 rows in set (0.00 sec)
mysql> describe domain_link;
+--------------+--------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+-------------------+-------+
| id | varchar(255) | NO | | | |
| time | timestamp | YES | | CURRENT_TIMESTAMP | |
| status_oper | varchar(255) | YES | | UNKNOWN | |
| status_admin | varchar(255) | YES | | UNKNOWN | |
| alarm_id_set | varchar(255) | YES | | NULL | |
| comments | varchar(255) | YES | | NULL | |
+--------------+--------------+------+-----+-------------------+-------+
6 rows in set (0.00 sec)
mysql> describe interdomain_link;
+--------------+--------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+-------------------+-------+
| id | varchar(255) | NO | | | |
| time | timestamp | YES | | CURRENT_TIMESTAMP | |
| status_oper | varchar(255) | YES | | UNKNOWN | |
| status_admin | varchar(255) | YES | | UNKNOWN | |
| alarm_id_set | varchar(255) | YES | | NULL | |
| comments | varchar(255) | YES | | NULL | |
+--------------+--------------+------+-----+-------------------+-------+
6 rows in set (0.00 sec)
mysql> describe perfsonar_utilization;
+------------+-------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+-------------------+-------+
| metadataId | varchar(30) | NO | | | |
| value | float(16,4) | NO | | | |
| valueUnits | varchar(30) | YES | | NULL | |
| timeValue | int(11) | NO | | | |
| ts | timestamp | YES | | CURRENT_TIMESTAMP | |
+------------+-------------+------+-----+-------------------+-------+
5 rows in set (0.01 sec)
|