[+] VPS pod serwer TeamSpeak - baza danych mysql

Konfiguracja serwerów, usług, itp.
Deireadh
Posty: 37
Rejestracja: 12 października 2013, 01:30

[+] VPS pod serwer TeamSpeak - baza danych mysql

Post autor: Deireadh »

Witam.
Jestem początkującym jeżeli chodzi o zarządzanie Linuksem przez SSH. Miałem serwer dedykowany, ale teraz jest to VPS. Debian 7.0 64bit.

Zmieniłem repozytoria, na te:

Kod: Zaznacz cały

deb http://ftp.pl.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.pl.debian.org/debian/ wheezy main non-free contrib 
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
deb http://ftp.pl.debian.org/debian/ wheezy-updates main non-free contrib
deb-src http://ftp.pl.debian.org/debian/ wheezy-updates main non-free contrib

Aktualizuję go tymi poleceniami:

Kod: Zaznacz cały

apt-get update    
apt-get upgrade

apt-get install apache2
apt-get install php5
apt-get install mysql-server
apt-get install mysql-client
apt-get install phpmyadmin


apt-get install libapache2-mod-auth-mysql
apt-get install php5-mysql

/etc/init.d/apache2 restart
Później poradnik tutaj: http://forum.teamspeak.com/showthread.p ... ian-Ubuntu

Nowy użytkownik, baza mysql i jej właściciel według instrukcji. Uruchamiam serwer TeamSpeak

Kod: Zaznacz cały

./ts3server_minimal_runscript.sh inifile=ts3server.ini start
i wyświetla:

Kod: Zaznacz cały

2013-10-12 12:56:31.302304|ERROR   |DatabaseQuery |   | mysql_real_connect() failed with error: Access denied for user 'root'@'localhost' (using password: NO)
Segmentation fault
Nie mam pojęcia o co chodzi, próbowałem nawet by TeamSpeak z mysql łączył się jako root i to samo. Możecie mi pomóc?
piroaa
Beginner
Posty: 324
Rejestracja: 11 kwietnia 2008, 14:46

Post autor: piroaa »

Pababam tak to wygląda u mnie :

Kod: Zaznacz cały

 ja@laptop:~$ su
Hasło: 
 root@laptop:/home/ja# mysql -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 root@laptop:/home/ja# /etc/init.d/mysql start
[ ok ] Starting MySQL database server: mysqld . . ..
[info] Checking for tables which need an upgrade, are corrupt or were 
not closed cleanly..
 root@laptop:/home/ja# mysql -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.30-1 (Debian)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
A jak się przedstawia u ciebie ?
Deireadh
Posty: 37
Rejestracja: 12 października 2013, 01:30

Post autor: Deireadh »

Identycznie u mnie. Dlaczego o to pytasz?
piroaa
Beginner
Posty: 324
Rejestracja: 11 kwietnia 2008, 14:46

Post autor: piroaa »

To pokaż jeszcze co masz w ts3server.ini oraz ts3db_mysql.ini
Deireadh
Posty: 37
Rejestracja: 12 października 2013, 01:30

Post autor: Deireadh »

ts3db_mysql.ini

Kod: Zaznacz cały

[config]
host='localhost'
port='3306'
username='ts3'
password='test04'
database='ts3'
socket=

ts3server.ini

Kod: Zaznacz cały

machine_id=
default_voice_port=9987
voice_ip=0.0.0.0
liscensepath=
filetransfer_port=30033
filetransfer_ip=0.0.0.0
query_port=10011
query_ip=0.0.0.0
dbplugin=ts3db_mysql
dbpluginparameter=ts3db_mysql.ini
dbsqlpath=sql/
dbsqlcreatepath=create_mysql/
logpath=logs
logquerycommands=0
piroaa
Beginner
Posty: 324
Rejestracja: 11 kwietnia 2008, 14:46

Post autor: piroaa »

Dziwne zrób jeszcze tak :

Kod: Zaznacz cały

 root@laptop:/home/ja# mysql -u ts3 -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 430
Server version: 5.5.30-1 (Debian)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use ts3;
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;
A dziwne jest to że według konfiguracji łączysz się na usera ts3 a w logu jest napisane Access denied for user 'root'@'localhost' (using password: NO) i to jeszcze bez hasła.
Deireadh
Posty: 37
Rejestracja: 12 października 2013, 01:30

Post autor: Deireadh »

Kod: Zaznacz cały

root@vpstestowy:~# mysql -u ts3 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 137
Server version: 5.5.31-0+wheezy1 (Debian)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use ts3;
Database changed
mysql> use ts3;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql>
piroaa
Beginner
Posty: 324
Rejestracja: 11 kwietnia 2008, 14:46

Post autor: piroaa »

Dobra to pokaż jeszcze co masz w logach tego serwera w katalogu z którego go odpalasz powinieneś mieć katalog logs w środku będą logi.
Deireadh
Posty: 37
Rejestracja: 12 października 2013, 01:30

Post autor: Deireadh »

Kod: Zaznacz cały

2013-10-18 18:17:52.628612|INFO    |ServerLibPriv |   | TeamSpeak 3 Server 3.0.10 (2013-09-27 10:13:58)
2013-10-18 18:17:52.628767|INFO    |ServerLibPriv |   | SystemInformation: Linux 2.6.32-042stab079.5 #1 SMP Fri Aug 2 17:16:15 MSK 2013 x86_64 Binary: 64bit
2013-10-18 18:17:52.628805|INFO    |ServerLibPriv |   | Using hardware aes
2013-10-18 18:17:52.631634|INFO    |DatabaseQuery |   | dbPlugin name:    MySQL plugin, (c)TeamSpeak Systems GmbH
2013-10-18 18:17:52.631684|INFO    |DatabaseQuery |   | dbPlugin version: 1
2013-10-18 18:17:52.635408|ERROR   |DatabaseQuery |   | mysql_real_connect() failed with error: Access denied for user 'root'@'localhost' (using password: NO)

Dodane:
Może podam Ci hasło roota VPS, pomógłbyś?
piroaa
Beginner
Posty: 324
Rejestracja: 11 kwietnia 2008, 14:46

Post autor: piroaa »

Nie.
Zrób jeszcze tak:
1. Przejdź do katalogu /root
2. Utwórz tam plik .my.cnf
3.do pliku wrzuć to:

Kod: Zaznacz cały

[client]
user=root
password="twoje_tajne_haslo"
Po tej operacji root powinien logować się bez hasła co teoretycznie powinno rozwiązać problem. Oczywiście jeśli teamspeak też uruchamiasz jako root.

Żeby sprawdzić czy logowanie bez hasła działa zaloguj się jako root i wpisz mysql powinno bez pytania o cokolwiek uruchomić CLI mysql-a.

Jeśli mimo to dalej nie zadziała to znaczy, że najprawdopodobniej masz nieodpowiednie wersje jakichś bibliotek poszukaj w google w ten sposób:

Kod: Zaznacz cały

teamspeak |DatabaseQuery |   | mysql_real_connect() failed with error: Access denied for user
ODPOWIEDZ