Cоздание базы SAMS в MySQL
переходим в каталог со скриптами создания баз SAMS: cd /usr/src/sams/mysql и там даем команду: mysq -u root show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| squidctrl |
| squidlog |
| test |
| tmp |
+--------------------+
6 rows in set (0.13 sec)
mysql> DROP DATABASE squidctrl;
Query OK, 15 rows affected (0.30 sec)
mysql> DROP DATABASE squidlog;
Query OK, 2 rows affected (0.03 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| tmp |
+--------------------+
4 rows in set (0.00 sec)
[root@localhost ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 100
Server version: 5.0.45 Mandriva Linux - MySQL Standard Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT ALL squidctrl.*TO sams@localhost IDENTIFIED BY "1";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'squidctrl.*TO sams@localhost IDENTIFIED BY "1"' at line 1
mysql> GRANT ALL ON squidctrl.*TO sams@localhost IDENTIFIED BY "1";
Query OK, 0 rows affected (0.06 sec)
mysql> GRANT ALL ON sqiudlog.*TO sams@localhost IDENTIFIED BY "1";
Query OK, 0 rows affected (0.02 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| tmp |
+--------------------+
4 rows in set (0.02 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| tmp |
+--------------------+
4 rows in set (0.00 sec)
ПОСЛЕ ЭТОГО ЗАШЕЛ В КАТАЛОГ /usr/src/sams/mysql НО ТАМ НЕ SAMS СКОПИРОВАЛ ВРУЧНУЮ И ВЫПОЛНИЛ КОМАНДЫ mysq -u root show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| squidctrl |
| squidlog |
| test |
| tmp |
+--------------------+
но ВЕБ ИНТЕРФЕЙСЕ ЛЕВАЯ ЧАСТЬ ВСЕ РАВНО ОТСУТСТВУЕТ
hELP
Так, вот с момента "ПОСЛЕ ЭТОГО ЗАШЕЛ В КАТАЛОГ /usr/src/sams/mysql НО ТАМ НЕ SAMS " подробнее..
В /usr/src/sams должны лежать распакованные исходники sams, том числе там долна быть папка mysql с файлами:
http://sams.nixdev.net/browser/tags/1.0.3/mysql
1. В этой папке есть эти файлы?
2. 'СКОПИРОВАЛ ВРУЧНУЮ И ВЫПОЛНИЛ КОМАНДЫ mysq -u root show databases;' что и куда вы скопировали?
--
NixDev - Open Source solutions for life
Порядок действий мой был такой
Скачал архив на рабочий стол
там же его распоковал
проинсталировал
./configure
make
make install
Дальше делал по инструкции для RET HAT
но в /usr/src/sams не оказалось папки sams и я расспакованный архив скопировал с рабочего стола в указанный путь /usr/src/sams
Вывод mysq show tables не зависит от каталога где вы его выполняете.
Чтобы пересоздать базу данных самс вам надо:
1. удалить базы с помощью drop table
после этого в выводе mysql show tables этих баз не будет
2. перейти в каталог с исходниками sams, оттуда в папку mysql и выполнить в этой папке:
mysql -u root < sams_db.sql
mysql -u root < squid_db.sql
теперь в mysql show tables базы должны быть
3. mysql -u root
GRANT ALL ON squidctrl.* TO sams@localhost IDENTIFIED BY "1";
GRANT ALL ON squidlog.* TO sams@localhost IDENTIFIED BY "1";
После этого все должно быть хорошо.
--
NixDev - Open Source solutions for life
Сделал вот результат
[root@localhost ~]# mysql -u roo -p
Enter password:
ERROR 1045 (28000): Access denied for user 'roo'@'localhost' (using password: NO)
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.0.45 Mandriva Linux - MySQL Standard Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> DROP TABLES;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql> DROP TABLE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql> drop table;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| squidctrl |
| squidlog |
| test |
| tmp |
+--------------------+
6 rows in set (0.10 sec)
mysql> DROP DATABASE squictrl;
ERROR 1008 (HY000): Can't drop database 'squictrl'; database doesn't exist
mysql> DROP DATABASE squidctrl;
Query OK, 15 rows affected (0.11 sec)
mysql> DROP DATABASE squidlog;
Query OK, 2 rows affected (0.03 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| tmp |
+--------------------+
4 rows in set (0.00 sec)
[root@localhost mysql]# mysql -u < sams_db.sql
mysql: option '-u' requires an argument
[root@localhost mysql]# mysql -u< sams_db.sql
mysql: option '-u' requires an argument
[root@localhost mysql]# mysql -u root < sams_db.sql
[root@localhost mysql]# mysql -u root < squid_db.sql
[root@localhost mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 115
Server version: 5.0.45 Mandriva Linux - MySQL Standard Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show tables;
ERROR 1046 (3D000): No database selected
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| squidctrl |
| squidlog |
| test |
| tmp |
+--------------------+
6 rows in set (0.05 sec)
mysql> Aborted
[root@localhost mysql]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 117
Server version: 5.0.45 Mandriva Linux - MySQL Standard Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT ALL ON squidctrl.*TO sams@localhost IDENTIFIED BY "1";
Query OK, 0 rows affected (0.05 sec)
mysql> GRANT ALL ON squidlog.*TO sams@localhost IDENTIFIED BY "1";
Query OK, 0 rows affected (0.00 sec)
НО В ВЕБ ИНТЕРФЕЙСЕ ВСЕ РАВНО НЕТ ЛЕВОЙ ЧАСТИ!!!!!!!!
Ну скриншот покажи тогда уже...
--
NixDev - Open Source solutions for life
Даю скриншет
Очень странно. Такое впечатление что у PHP есть проблемы но он сообщения об ошибках не выводит.
Посмотрите на /var/log/apache[httpd]/error.log может там какие ошибки сыплются.
--
NixDev - Open Source solutions for life
К сожалению не понимаю что означают эти ошибки но вот кусок файла error.log
[Mon Oct 13 13:06:35 2008] [error] [client 127.0.0.1] PHP Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /usr/local/share/sams/src/admintray.php on line 72, referer: http://localhost/sams/index.html
[Mon Oct 13 13:06:35 2008] [error] [client 127.0.0.1] PHP Fatal error: require() [function.require]: Failed opening required '' (include_path='.:/usr/lib/php/:/usr/share/pear/') in /usr/local/share/sams/src/admintray.php on line 79, referer: http://localhost/sams/index.html
[Mon Oct 13 13:06:35 2008] [error] [client 127.0.0.1] PHP Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /usr/local/share/sams/lframe.php on line 67, referer: http://localhost/sams/index.html
[Mon Oct 13 13:06:35 2008] [error] [client 127.0.0.1] PHP Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /usr/local/share/sams/lframe.php on line 81, referer: http://localhost/sams/index.html
Ну вот в принципе и причина:
[Mon Oct 13 13:06:35 2008] [error] [client 127.0.0.1] PHP Fatal error: require() [function.require]: Failed opening required '' (include_path='.:/usr/lib/php/:/usr/share/pear/') in /usr/local/share/sams/src/admintray.php on line 79, referer: http://localhost/sams/index.html
Как минимум стоит попробовать настроить как написано в примере по установке:
http://sams.nixdev.net/wiki/ASPLinux#%D0%9D%D0%B0%D1%81%D1%82%D0%BE%D0%B...
Я ведь не зря на них ссылки сразу давал, там очень много примеров дано.
--
NixDev - Open Source solutions for life
При всем уважении к вам все же непонятно что не так
И в каком направлении смотреть
Настройка PHP, там есть отдельный раздел.
--
NixDev - Open Source solutions for life
Все эти рекомендации я выполнил
с самого начала
еобходимо в файле /etc/php.ini изменить строки.
safe_mode = on
disable_functions = "chdir,dl,ini_get_all,popen,proc_open,passthru,pcntl_exec"
Затем рестартануть Apache
[root@LinProxy etc]# service httpd restart
Останавливается httpd: [ ОК ]
Запускается httpd: [ ОК ]
[root@LinProxy etc]#
Проверьте что в /etc/ нет других файлов настроек php, а также посмотрите в папку /etc/apache/... на предмет наличия конфига php. В некоторых дистрибах настройки php для apache отличаются от настроек php.
--
NixDev - Open Source solutions for life
В директории /etc/httpd/conf/ конфиг лежит httpd.conf
В etc/ других файлов похожих на файлы настройки php не найдено корме указанного php.ini
ошибка изменилась
[Mon Oct 13 16:48:18 2008] [error] [client 127.0.0.1] PHP Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /usr/local/share/sams/lframe.php on line 67, referer: http://localhost/sams/
[Mon Oct 13 16:48:18 2008] [error] [client 127.0.0.1] PHP Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /usr/local/share/sams/lframe.php on line 81, referer: http://localhost/sams/
Что делать help
Ошибки явно в настройке PHP, но я давно с этим не сталкивался и не помню то на это влияет.
--
NixDev - Open Source solutions for life
Подсказали выполнить команду следующую результат ниже. Похоже проблемы с PHP и Apache но что именно?
[root@localhost ~]# apachectl restart
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[root@localhost ~]#
Это не критичная проблема, с ней можно жить и все будет хорошо.
Хотя проблема в некоректных настройках apache.
--
NixDev - Open Source solutions for life