How to get protocol, characterset, mysql info?

 
Thread Tools Search this Thread
Top Forums Web Development MySQL DevZone RSS How to get protocol, characterset, mysql info?
# 1  
Old 02-25-2010
How to get protocol, characterset, mysql info?

Hi,

I know the API to get protocol version, character set etc. If I want to find out the current protocol version, current user character set, mysql info, mysql server info wihtout using these API -
mysql_get_server_info()
mysql_info()
mysql_get_proto_info()
mysql_character_set_name()
mysql_get_client_info().

Is there any other way to get these information without using API?

I don't want to use API instead Shall I get these information from Infomrmation_schema?

Can I fetch these information directly accessing enviornment variable if possible?

---------- Post updated 02-25-10 at 12:53 AM ---------- Previous update was 02-24-10 at 11:49 PM ----------

I find out the value of protocol, version, character set, host name using

select @@hostname
select @@version
select @@protocol_version
select @@character_server_set.

But couldn't find out the how to get values of

mysql_get_client_info()
mysql_info()
mysql_stat()
mysql_thread_safe()
without using it in the same manner used for protocol,character set etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Characterset conversion problem using iconv command

Hi Friends, I am not able to conver character set from UTF-8 to IBM-284 throwing an error "cannot open convertor" . Could you please help me how to get out of this error. Below command is working fine iconv -f ISO8859-15 -t UTF-8 fromfile.txt > tofile.txt But the below command is... (2 Replies)
Discussion started by: sivakumarl
2 Replies

2. UNIX and Linux Applications

MySQL Daemon failed to start - no mysql.sock file

After doing a yum install mysql mysql-server on Fedora 14 I wasn't able to fully install the packages correctly. It installed MySQL 5.1. I was getting the following error when running the: mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)... (3 Replies)
Discussion started by: jastanle84
3 Replies

3. Shell Programming and Scripting

decimal value for particular characterset

Hi, I need some help to get decimal value of some particluar character set for e.g. in windows-1251 characterset ж --> 230 Please help and suggest way to achive same. (7 Replies)
Discussion started by: peeyushgehlot
7 Replies

4. UNIX for Advanced & Expert Users

mysql would not start: missing mysql.sock

I recently installed mysql-standard-5.0.21-solaris9-sparc-64bit.pkg on a Solaris 9 machine (SunOS 5.9 Generic_118558-19 sun4u sparc SUNW,Ultra-250). The package installation went very smooth, however, starting mysql is a different story. I get the message below everytime I try to start mysql: #... (2 Replies)
Discussion started by: xnightcrawl
2 Replies

5. UNIX for Advanced & Expert Users

MySQL problem >> missing mysql.sock

MySQL on my server is down.... I figured out that the mysqld process isn't running. When I try to run it, it says it can't find mysql.sock Any suggestions? Here's what I can't do: can't be root don't have physical access (do stuff via SSH) reinstall MySQL (need to keep the current MySQL... (8 Replies)
Discussion started by: _hp_
8 Replies
Login or Register to Ask a Question
PDO_MYSQL-DSN(3)							 1							  PDO_MYSQL-DSN(3)

PDO_MYSQL DSN - Connecting to MySQL databases

	The PDO_MYSQL Data Source Name (DSN) is composed of the following elements:

	      o DSN prefix
		- The DSN prefix is mysql:.

	      o host - The hostname on which the database server resides.

	      o port - The port number where the database server is listening.

	      o dbname - The name of the database.

	      o unix_socket - The MySQL Unix socket (shouldn't be used with host or port).

	      o charset  - The character set. See the character set concepts documentation for more information.  Prior to PHP 5.3.6, this element
		was silently ignored. The same behaviour can be partly replicated with the PDO::MYSQL_ATTR_INIT_COMMAND driver option, as the fol-
		lowing example shows.

	      Warning

		      The  method  in  the  below  example  can only be used with character sets that share the same lower 7 bit representation as
		     ASCII, such as ISO-8859-1 and UTF-8. Users using character sets that have different representations (such as UTF-16 or  Big5)
		     must use the charset option provided in PHP 5.3.6 and later versions.

	      Example #1

		      Setting the connection character set to UTF-8 prior to PHP 5.3.6

		     <?php
		     $dsn = 'mysql:host=localhost;dbname=testdb';
		     $username = 'username';
		     $password = 'password';
		     $options = array(
			 PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
		     );

		     $dbh = new PDO($dsn, $username, $password, $options);
		     ?>

       +--------+-----------------------------------------------+
       |Version |						|
       |	|						|
       |	|		   Description			|
       |	|						|
       +--------+-----------------------------------------------+
       | 5.3.6	|						|
       |	|						|
       |	|  Prior to version 5.3.6, charset was ignored. |
       |	|						|
       +--------+-----------------------------------------------+
       Example #2

	      PDO_MYSQL DSN examples

	       The following example shows a PDO_MYSQL DSN for connecting to MySQL databases:

	      mysql:host=localhost;dbname=testdb

	      mysql:host=localhost;port=3307;dbname=testdb
	      mysql:unix_socket=/tmp/mysql.sock;dbname=testdb

       Note

	      Unix only:

	       When  the host name is set to "localhost", then the connection to the server is made thru a domain socket. If PDO_MYSQL is compiled
	      against libmysqlclient then the location of the socket file is at libmysqlclient's compiled in location. If  PDO_MYSQL  is  compiled
	      against mysqlnd a default socket can be set thru the  pdo_mysql.default_socket setting.

PHP Documentation Group 													  PDO_MYSQL-DSN(3)