Skocz do zawartości
bizon11

Krzaki Na Vps-ie Hosteurope.de

Polecane posty

Witam

 

Mam problem z serwerem MySQL: 5.0.32

 

Otóż zamiast polskich znaków występują krzaki (przy odczytywaniu w php)

 

Poniżej zamieszczam plik konfiguracyjny

 

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port		= 3306
socket		= /var/run/mysqld/mysqld.sock

#init-connect='SET NAMES latin2'



# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * Basic Settings
#

init_connect="SET NAMES 'latin2'"
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
language	= /usr/share/mysql/polish
skip-external-locking
character-set-server = latin2
collation-server = latin2_general_ci
#L+
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 87.230.78.234
#
# * Fine Tuning
#
key_buffer		= 16M
max_allowed_packet	= 16M
thread_stack		= 128K
thread_cache_size	= 8
#max_connections		= 100
#table_cache			= 64
#thread_concurrency	 = 10
#
# * Query Cache Configuration
#
query_cache_limit	   = 1M
query_cache_size		= 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log		= /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log_slow_queries	= /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
#server-id		= 1
log_bin			= /var/log/mysql/mysql-bin.log
# WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian!
expire_logs_days	= 10
max_binlog_size		 = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet	= 16M

[mysql]
#no-auto-rehash	# faster start of mysql but no tab completition

[isamchk]
key_buffer		= 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1


#
# * IMPORTANT: Additional settings that can override those from this file!
#
!includedir /etc/mysql/conf.d/

 

Oraz plik informacje o kodowaniu bazy:

 

| character_set_client			| latin2					  |
| character_set_connection		| latin2					  |
| character_set_database		  | latin2					  |
| character_set_filesystem		| binary					  |
| character_set_results		   | latin2					  |
| character_set_server			| latin2					  |
| character_set_system			| utf8						|
| character_sets_dir			  | /usr/share/mysql/charsets/  |
| collation_connection			| latin2_general_ci		   |
| collation_database			  | latin2_general_ci		   |
| collation_server				| latin2_general_ci		   |

 

Przypuszczam że trzeba zmienić character_set_system tylko jak?

Proszę o podanie innej działającej konfiguracji

 

Bazę mam w latin2_general_ci

 

Pozdrawiam i liczę na pomoc :D

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
Proszę o podanie innej działającej konfiguracji
A w google szukałeś? od groma jest przykładów... np:
[mysqld]

language=/usr/share/mysql/polish

character-sets-dir=/usr/share/mysql/charsets

default-character-set=latin2

default-collation=latin2_general_ci

skip-character-set-client-handshake

 

[mysql.server]

default-character-set=latin2

 

[mysqldump]

default-character-set=latin2

 

[mysql]

default-character-set=latin2

 

[client]

default-character-set=latin2

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

w mysql 4.1 i nowszym jest rochę inna obsluga polskich znaków.

 

jesli zmieniles plik my.cnf i nie pomoglo to po nawiązaniu połączenia w skrypcie php dodaj zapytanie:

SET NAMES latin2

 

Na pewno pomoże.

 

Ed

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Zamienię się trochę w archeologa ale warto dać rozwiązanie dla potomnych ;]

 

Problem rozwiązuje dodanie do my.cnf

 

[mysql]
default-character-set=latin2

[mysql.server]
default-character-set=latin2

[mysqldump]
default-character-set=latin2

[mysqld]
language=/usr/share/mysql/polish
character-sets-dir=/usr/share/mysql/charsets
default-character-set=latin2
default-collation=latin2_general_ci
skip-character-set-client-handshake

[client]
default-character-set=latin2

 

Czyli to co podał Adrian

 

Oraz edycji charset /etc/apache2/conf.d/

 

By mieć w tym taki wpis:

 

AddDefaultCharset ISO-8859-2

AddDefaultCharset UTF-8

 

Pozostaje tylko edycja php.ini

 

Edytujemy

 

default_mimetype = "text/html"
;default_charset = "iso-8859-1"

 

na

 

default_mimetype = "text/html"
default_charset = "iso-8859-2"

 

Restartujemy apache i mysql i cieszymy się polskimi znakami ;]

 

Jeśli korzystamy z innego serwera np. lighttpd to omijamy krok z apache i też powinno być ok ;]

 

Proszę moderatora o zamknięcie tematu.

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

 Witam mam problem w stronie postawiłem server i nie mogę zrobić resetu zadną postacią pisze "Fatal error: Call to a member function fetchrow() on a non-object in C:\xampp\htdocs\includes\character_manager.php on line 51"

 

 

 

 

 CODE 

 

{

$row = $result->fetchrow();

 

$query2="Select ConnectStat from MEMB_STAT where memb___id='$row[9]'";

$result2 = $db->Execute($query2);

$row3 = $result3->fetchrow();

$row2 = $result2->fetchrow();

$rank = $i+1;

if($row[1] == 0){ $row[1] ='DW';}

if($row[1] == 1){ $row[1] ='SM';}

if($row[1] == 16){ $row[1] ='DK';}

if($row[1] == 17){ $row[1] ='BK';}

if($row[1] == 32){ $row[1] ='ELF';}

if($row[1] == 33){ $row[1] ='ME';}

if($row[1] == 48){ $row[1] ='MG';}

if($row[1] == 64){ $row[1] ='DL';}

 

$reset_no_zen = '<span class=normal_text>Za malo zen</span> <img src=./images/warning.gif align=top>';

$reset_no_level = '<span class=normal_text>Za maly lvl by uzyskac reset (min 400)</span> <img src=./images/warning.gif align=top>';

$reset_allow = '<a href=#><img src=images/reset.png border=0 onclick=reset_chr.submit()></a>';

 

$pk_no_zen = '<span class=normal_text>Za malo zen</span> <img src=./images/warning.gif align=top>';

$pk_no_kill = '<span class=normal_text>Nie jestes morderca</span> <img src=./images/warning.gif align=top>';

$pk_allow = '<a href=#><img src=images/clear_pk.png border=0 onclick=clearpk.submit()></a>';

 

$stats_no_points = '<span class=normal_text>Nie ma punktow do rozdania</span> <img src=./images/warning.gif align=top>';

$stats_allow = '<a href=#><img src=images/add_stats.png border=0 onclick=stats.submit()></a>';

 

$info_query = $db->Execute("SELECT Imie,klasa,Level,Reset,pieniadze,PkLevel,LevelUpPoint from Character where name='$row[0]'");

$info_result = $info_query->fetchrow();

$info_result2 = $info_query->fetchrow();

 

$resetmoeny=$info_result[4]-($muweb['resetmoney']);

$money_check = $info_result[4]-($muweb['pkmoney']);

 

if($resetmoeny < 0){$reset_="$reset_no_zen";}

elseif($info_result[2] < $muweb['resetlevel']){$reset_="$reset_no_level";}

elseif($info_result[2] >= $muweb['resetlevel']){$reset_="$reset_allow";}

 

if($money_check < 0){$pk_="$pk_no_zen";}

elseif($info_result[5] == 3){$pk_="$pk_no_kill";}

elseif($info_result[5] > 3){$pk_="$pk_allow";}

 

if($info_result[6] <= 0){$stats_="$stats_no_points";}

elseif($info_result[6] >= 1){$stats_="$stats_allow";}

 

$reset_table = "<table width=150 border=0 cellspacing=2 cellpadding=0><tr><td><form action=\'\' method=post name=reset_chr id=reset_chr><table width=260 border=0 cellspacing=0 cellpadding=0><tr><td width=110><span class=normal_text>Reset Character:</span></td><td width=130 valign=bottom><div align=left><input name=reset_character type=hidden id=reset_character value=$row[0]><span class=style62>$reset_</span></div></td></tr></table></form></td></tr></table>";

$clearpk_table = "<table width=150 border=0 cellspacing=2 cellpadding=0><tr><td><form action=\'\' method=post name=clearpk id=clearpk><table width=260 border=0 cellspacing=0 cellpadding=0><tr><td width=110><span class=normal_text>Clear Pk: </span></td><td width=130 valign=bottom><div align=left><input name=clearpk_character type=hidden id=clearpk_character value=$row[0]><span class=style62>$pk_</span></div></td></tr></table> </form></td> </tr></table>";

$statsadd_table = "<table width=150 border=0 cellspacing=2 cellpadding=0><tr><td><form action=\'\' method=post name=stats id=stats><table width=260 border=0 cellspacing=0 cellpadding=0><tr><td width=110><span class=normal_text>Stats Add: </span></td><td width=130 valign=bottom><div align=left><input name=stats_character type=hidden id=stats_character value=$row[0]><span class=style62>$stats_</span></div></td></tr></table></form></td></tr></table>";

 

$status_check="Select ConnectStat from MEMB_STAT where memb___id='$row[9]'";

$status_reults = $db->Execute($status_check);

$status = $status_reults->fetchrow();

 

if($status[0] == 0){ $status[0] ='<img src=./images/Offline.gif width=6 height=6>';

}

if($status[0] == 1){ $status[0] ='<img src=./images/Online.gif width=6 height=6 >';

}

 

$content .="<tbody><tr><td align=left><font color=#CCCCCC>$rank.</font></td>

<td align=left>$status[0] <a class=helpLink2 href=? onclick=\"showHelpTip(event, '$reset_table $clearpk_table $statsadd_table' ,false); return false\">$row[0]</a></td>

<td align=left><font color=#CCCCCC>$row[1]</font></td>

<td align=left><font color=#CCCCCC>$row[2]</font><small style='color:red;'>[$row[3]]</small></td>

<td align=left><font color=#CCCCCC>$row[4]</font></td>

<td align=left><font color=#CCCCCC>$row[5]</font></td>

<td align=left><font color=#CCCCCC>$row[6]</font></td>

<td align=left><font color=#CCCCCC>$row[7]</font></td>

</tr></tbody>";

}

$content .="</table>";

show($content);

?>

 

 

 

 

 

Prosiłbym o pomoc z góry dzieki i pozdrawiam.

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Witam mam problem w stronie postawiłem server i nie mogę zrobić resetu zadną postacią pisze "Fatal error: Call to a member function fetchrow() on a non-object in C:\xampp\htdocs\includes\character_manager.php on line 51"

Pierwsze primo: Podpinasz się po temat niemający nic wspólnego z Twoim problemem.

Drugie primo: Wygląda to coś jak PDO. A tam nie ma fetchrow(), jest za to fetch().

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Bądź aktywny! Zaloguj się lub utwórz konto

Tylko zarejestrowani użytkownicy mogą komentować zawartość tej strony

Utwórz konto

Zarejestruj nowe konto, to proste!

Zarejestruj nowe konto

Zaloguj się

Posiadasz własne konto? Użyj go!

Zaloguj się


×