Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Switch Query Logging While The Server Is Running


It would be nice if general query logging could be switched on and off while the MySQL server is running, and not only at startup time. While debugging an application that uses foreign database access libraries, this would be very helpful. One could switch on logging, perform an activity, switch off logging, and look what has happened.

Otherwise, the server has to be restarted to change logging, which is a bit annoying...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Temporarily Switch Off Logging
I am running MySQL v3.23.52-log on SuSI v8.0 platform.

log_bin is set ON.

How can I temporarily switch off logging?

Warning: One Can Only Use The -- User Switch If Running As Root
I started the mysql database with the "safe_mysqld" command and with
the user who own mysql. in the errr-log file, I have that:

050123 23:16:50 mysqld started
Warning: One can only use the --user switch if running as root
/exlibris/sfx_ver/sfx_version_2/app/mysql/libexec/mysqld: ready for
connections

What is the meaning of

"Warning: One can only use the --user switch if running as root" ?

Logging Into Server
I have a linux box with MySQL.

The following fails. If I try to login locally using

mysql -u USERNAME -p

If I go to another computer on the network and try using the same user
name and password by:

mysql -h SERVER ADDRESS -u USERNAME -p

This login is successful.

Does anyone know why the first operation fails?

Logging Into Server
I am running Mac OS X 10.4 (PPC) I have installed MySQL server and have the use account mysql but I have no idea of the password. When the install ran it did not give me the opportunity to set a password and I can not find anywhere that states a default password.

Server Log Not Logging All Queries
I started the general query log with

mysqld --log

On my machine this command works fine and every select, update and all
statements are logged. I tried the same command on another machine and
many many queries are missing, I am running apache, PHP on that machine
and all the queries come through the web on localhost.

I wonder why this is happening?

How Do I Start Logging On Windows Live MySQL Server?
As I understand it, the server has to be shut down for the logging to be successfully started. Is this correct?

I have been experimenting on a local MySQL server to make sure I know what to do on the production server. My production server has a my.ini file at the location c:Program FilesMySQLMySQL Server 4.1my.ini with various config stuff in it. Would it be ok for me to add the following under the [mysqld] part of the file:

log=/logs/mysqld.log

Thus creating a file named 'mysqld.log' in the folder 'logs'.
The main things I need to log are the SQL Statements being executed and the IP Addresses/hostname of the connections. What type of log would be best for this? Also how do I make it so that the log doesn't grow ridiculously large?

Running .sql Script On Server?
I just installed a .php based mailing list program, which I've never done before, and one of my instructions is to "Run the mysql.sql script to create the necessary tables in the database." I have no idea what that means or how to do it. Is there an easy set of instructions anyone can give me on this one?

Check Which Server Running
i'd like to know how control which server is actually running between mysqld and mysqld-max.

MySQL + SQL Server 2000 Both Running On XP Pro?
I've had mysql on my machine plenty of times with no trouble currently i have SQL Server 2000 Trial running but never both at once. Unfortunately i have to have them both on at the moment.

So before i install and mess everything up, Does anyone here have this setup?

I basically want to get php/mySQL/MSSQL running with IIS

How Do I Set Query Logging
I have a situation where my database is deleting records.

I would like to enable logging but this produces a huge text file. Also I am not sure how to read the results.

I am using MySQL 3.23 (the IT department won't upgrade).

Can anyone tell me the most efficient way to set logging for a specific database? I just need to monitor whether a process is deleting these records.

Also how would I read this information?

Are there any known problems like this with MySQL 3.23?

Query Logging?
I cannot get my query logging to work.

I put

log=hostname.log

in my.ini and at some point it WAS recording a log, but it since stopped. I started the service, stopped the service, did everything. I logged into my machine as admin, as the user, did it all again... cant get it to work.

I am running mysql 5 as part of the XAMPP stack. I installed it on this machine as admin and can run it as a service, but I cant get the log to work.

Any help would be appreciated. I really need to see what SQL is being executed.

Can't Turn On Slow Query Logging
long_query_time = 1
log-slow-queries = /var/lib/mysql/slow_queries.log
Is the above syntax not correct for enabling slow query logging? All examples I've seen have the dashes in the second variable and underscores in the first.

When I restart MySQL with those lines in my.cnf, it fails to start, but writes nothing to its error log.
/var/lib/mysql/slow_queries.log exists, is owned by mysql, and has read/write permission.

Turning On Slow Query Logging?
Background: I paid a young admin set me up on a database server. He installed the basic I needed for the server...at my request...No Cpanel...mysql and apache and some tight security w/o even a domain name to SSH into. Unfortunately, he's a busy kid, and teens sometimes don't realize that people depend on them...and well, I can't really seem to get him to do much so I gave up and figured it's a good way to force me to learn all this myself...
Well anyway, now I want to turn on Slow Query logging. But before I do that, I need to know how MySQL is running. Is SQLogging turned on already? Where is it logging to? So first thing I want to look up is, when the server is rebooted, what's the command to restart mysql? No clue. How do I change the setting? And of course, the server is production, so when I make the change, it needs to be quick, it needs to be smooth, and I need to be able to roll back to the previous config if necessary.
I'm running Redhat Enterprise.

How Do I Enable Query Logging? Is It Secure?
How do I enable query logging? I am using version 4.1.22-standard

How Can I Dump (mysqldump) With Skip Query Logging ?
How can i dump (mysqldump) with skip query logging?

Now, when i run mysqldump.

mysql log ( query log ) default running/keeping all in result mysqldump.

It's possible ? to run mysqldump without query logging?

How Can I Dump (mysqldump) With Skip Query Logging ?
How can i dump (mysqldump) with skip query logging?

Now, when i run mysqldump. mysql log ( query log ) default running/keeping all in result
mysqldump.

It's possible ? to run mysqldump without query logging?

Problem With MySQL On A Dell PowerEdge 1850 Running Windows 2K Server
I have 3 friends that installed MySQL 4.0.24 on their Windows 2000 Server platforms all on Dell PowerEdge 1850's.

After one to two days - Windows gives an error that the EVENT LOG IS FULL and the applications lose connectivity to the DB. I have to restart the system in order to bring it back up.

THis does not happen on Win 2003 nor 2000 Pro nor XP Pro. Only on Win 2k server on Dell PowerEdge 1850.

Running A Query
I'm following a guide, and it says to do this stuff in my mysql database. However, whenever I try to run it (with slight alterations to the code to try to get it to work) it always gives me a syntax error.

What do I have to type exactly? Hers the code:

mysql> CREATE TABLE chat

-> chtime DATATIME,

-> nick CHAR (10) NOT NULL,

-> words CHAR (150);

How To Switch Users
I tryed my sql manual and could not find a solution to my problem.

when i open mysql command line client 5.x it prompts for root password and when supplied i loged in sucessfully. that is ok.

my question is how to login as a diffrent user from mysql prompt?

assume currently i have loged in as root and wanted to login as xyz.

Cancel A Running Query
Does anyone know if there is a way to cancel a query once it has started executing? I've thought of killing the process through "show processlist". Is there a better way (since I'm calling SQL from a Java application)?

MYSQL Running Query On Data Through Php...
I am trying to take address info from 5 different fields in mysql, concatenate them into one string of text and have then run through a POST, like you would in a form, and have them spit out on the other end into the database the Lat and Lon of the address... I can do it manually, but I would like to do it automatically...

I would like to know if I am going at this right...

Psuedo

QUERY=SELECT addressNumber, addressStreet, city, state, zip FROM table
$addressStr=addressNumber + " " + addressStreet + ", " + city + ", " + state

RUN IT THROUGH A POST SOMEHOW??? and call GEOCODER from my manual insert script...

$sql=INSERT INTO table SET lat='$lat', lon='$lon'


Running Query For Column Names
Is there a way to run a query just to see what the columns are in a database?

Switch To Different Database Host Location
I am working on a JAVA project at the moment which requires me to have a command that can switch the MySQL database host to a different IP or Location without recompiling or restarting.

Would anyone know if there is a MySQL command that I could use for this?

Switch Hosts And Preserve Records
I decided that my host isn't for me but I have a lot of sql info that I don't want to be lost.
Is there some query I can use to get out all the contents of my database into a form where I can easily input it back into a new one?

Running Multiple Queries In Query Browser
What is the magic word to get query browser to execute a string of queries?

Running A 'Distinct' Query Returns Some Results TWICE !?
I've spent hours trying to find out why a perfectly simple query that uses the 'distinct' keyword such as:

Select distinct(field1)
From tablename;

works fine based on eg. field1, but when running it on eg. field2 in the very same table, it returns 2 results (yet, only on some words!). Pls see example of result below:

Eg of a 'faulty' result: .....

How Do You Cancel Out Of A Long Running Query W/out Exiting Mysql?
How does one cancel out of a long-running query that has been entered at the command line w/out exiting completely out of the mysql interface?

Running Multiple Update Querries In Query Browser
I am trying to run multiple update statements together from the MySQL Query Browser. For example:

update table1 set field1 = "123", field2 = '456' where rowid = 'abc'
update table1 set field1 = "321", field2 = '654' where rowid = 'efg'

I can run them one at a time, but I cannot run multiple updates at the same time. I have 1100 of them to run, so I don't want run them individually.

In M$ SQL I can just put a ; or GO at the end of each line to seperate it from the next. How can I do this in MySQL?

Lost Connection To MySQL Server During Query / Server Has Gone Away
All of a sudden the server stopped working. When trying to execute a simple INSERT both from PHP and Query Browser, the server crashes and I get either "Lost connection to MySQL server during query" or "Server has gone away" errors.

The problem started on 5.0.18, and upgrading to 5.0.41 didn't help. I'm using Windows XP SP2.

I've seen quite a few posts on similar problems, but no real solutions though. Is that a bug?

Query For Server Name
I am running a mysql cluster with several API nodes. I just setup load balancing and getting ready to do some tests. I want to run a query for something like servername on a loop and see if my load balancer is sending every other query to different API nodes. Is there a select statement I can use to find out the server name?

Mysql Query Between Two Server
I have two Mysql server and I have to execute a query like this:

insert into thisserver.table1
select * from anotherserver.table1 where anotherserver.table1.columnid not in
(select * from thisserver.table1)

Is it possible (like in MS Sql)?

Convert Sql Server Query
I am trying to convert an old sql server query into a mysql query.This is the current query:
select filename, folder2, folder1 from history as T1 where T1.time_str like '01/Jan/07*' and T1.billed = 'no' and T1.username like 'zummy12' and T1.time_str = (Select Top 1 T2.time_str From history T2 Where T1.folder2 = T2.folder2 and T1.username = T2.username And Left(T1.time_str,12) like Left(T2.time_str,12) Order By T2.[date_time] Desc)

which produces the following error:

(1064, "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 'Select Top 1 T2.time_str From history T2 Where T1.folder2 = T2.")


Lost Connection To Mysql Server During Query
While working in application VB with MySQL this error occurs,

'lost connection to mysql server during query'

Mostly this error occurs during multiple users working in exe.

How to rectify this error.

Lost Connection To MySQL Server During Query
I recently installed an ubuntu LAMP server for my website and upon trying a script that uses a mysql database (which I set up the tables via phpmyadmin) and I get this error:

Warning: mysql_connect(): Lost connection to MySQL server during query in /home/tanner/Desktop/bot/DoctorWho/db_connect.php on line 4

I've searched the forums and I've gotten no answers. Anyone know the answer?

Lost Connection To MySQL Server During Query
I downloaded the MySQL trail version a few month ago, it worked fine. however after i brought 1 x EMS MySQL Manager Professional (Non-commercial license) and registered but the tool doesn't work anymore... when i try to register a database and try to get it connect, it through me a error message "Lost connection to MySQL server during query". more to it... when i try to create a database at my local host, a error messate says "can't connect to MySQL server on localhost (10061)... PLease help!


Lost Connection To Mysql Server During Query
I have following problem: when I try to connect from Windows XP to mysql
server (linux computer), I get the following error: Lost connection to mysql
server during query. This happens when I test the connection.

I have firewall in linux, so I opened the port 3306. Is there something else
I need to change to make sure that the connection will work properly?

GO Keyword Like SQL Server Query Editor--for MYCC?
Is there an equivalent for MyCC, of the go keyword used in SQL servers Query Analyzer to execute multiple statements.

LIke I want to

Use DB1
go

SELECT * from WHATEVER
go

Lost Connection To Mysql Server During Query
I'm running mysql stored procedure using VB as front end. While clicking Ok button in application it calls 3 stored procedures and returns a resultset. First time it works properly. If second time clicked the error 'lost connection to mysql server during query' displayed. Third time works fine. Like this alternatively throws error message.

Lost Connection To MySQL Server During Query
After changing RAM and the ethernet card of my DB server, the problem of getting
frequent:

Database error (error code 102)
Could not connect to database server (Lost connection to MySQL server during query)

Still occurs ;/

I've tried to eliminate all factors (like multiple servers, load-balancers,
replication etc) so I have wrote a php script that only does the following:

- opens db connection
- does a simple select
- closes db connection

If I refresh this page over and over, every 6-7 times I get the above error.
Anyone have any further solutions, ?? I've tried the software (re-installing
mysql, upgrading, etc....) and tried the hardware (RAM, ethernet card). Nothing
seems to help.

The DB server is Linux Redhat 7.3 with the 2.4.18-3smp kernel. I am running
MySQL standard 4.0.13.

Lost Connection To MySQL Server During Query (error_no 2013)
I am using PHP to invoke mysql_query to my database.
In most cases everything works fine and the query executes perfectly.
Sometimes, I will get a burst of errors and the query will fail with the following error:
Lost connection to MySQL server during query (err_no 2013)



ERROR 2013: Lost Connection To MySQL Server During Query
I get this error when i try to remotely connect to my mysql server, it has been working until i changed the server's ip and isp, when i re-change the mysql server to the old ip address (first isp), it's working again.

ERROR 2013: Lost Connection To MySQL Server During Query
I get this error when i try to remotely connect to my mysql server, it has been working until i changed the server's ip and isp, when i re-change the mysql server to the old ip address (first isp), it's working again....

ERROR 2013: Lost Connection To MySQL Server During Query
I have recently installed suse 9.0 linux which has MySQL 4.0.15 as part
of the distribution. After I set up my users I was able to use
mysqldump and pipe it into mysql on my windows machine running 4.0.16 to
dump a database to the linux box. However, now when I try to login to
the linux box from another machine on the network I get a query timed
out error immediately after I enter the command line to start the mysql
client.

mysql -h 192.168.1.2 -u cdw -pxxxxxx
ERROR 2013: Lost connection to MySQL server during query

The error happens with in a small fraction of a second after I type in
the command. I can login from the linux machine just fine though.

Error 2013: Lost Connection To MySQL Server During Query
I have MySQL 4.1.10 running successfully on an office XP machine, but
when I try to set up similar XP box at home I continually get this
error: "Error 2013: Lost connection to MySQL server during query".
The install went fine, and Windows XP is recognizing it as a running
service. But whenever I try to connect via one of my GUI applications
(e.g., MySQLFront), the error appears.

I have scoured this forum and Google looking for this error, but
haven't found anything helpful so far. This post ...
(http://forums.mysql.com/read.php?11,10684,10684) seemed similar, but
my service does not stop when I hit the error.

I've lost a couple days to this problem, and I've uninstalled and
reinstalled the app several times. I don't know where to go next. I
need to have 4.1 running because we need the Unions and Subqueries.

Query Db From Remote Server Via Shell Script - Newbie, Be Gentle.
I'm looking to connect to a remote mySQL database from a UNIX server, but don't know how.  I downloaded the 'connector' software from mysql.com, but the /bin directory is empty...

Am I missing something?

Error 2013: Lost Connection To MySQL Server During Query
I have MySQL 4.1.10 running successfully on an office XP machine, but when I try to set up similar XP box at home I continually get this error: "Error 2013:  Lost connection to MySQL server during query".

The install went fine, and Windows XP says it has started and is running as a service.  But whenever I try to connect via one of my GUI applications (e.g., MySQLFront), the error appears.

I have scoured this forum and Google looking for this error, but haven't found anything helpful so far.  I've lost a couple days to this problem, and I've uninstalled and reinstalled the app several times.  I don't know where to go next.  I need to have 4.1 running because we need the Unions and Subqueries.

Error 2013: Lost Connection To MySQL Server During Query
I get this message instantly (< 1 second) when I try to connect to the MySQL server from a remote host. I am using "mysql" at the remote client. Does not matter where the remote client is: on Solaris, on RH 7.2, on Fedora. Same thing every time.

I am using the the mysqld as it comes out of the box on Red Hat Linux 8.0.

I tried a google search on Error 2013, and there are a lot of responses:

Logging In
I'm having trouble logging into my sql server, I'm running version 4.0 just about anything I type in gives me this error message

"Error
SQL query:

mysql

MySQL said:

#1064 - 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 'mysql' at line 1 "

Can anyone help me with this problem?

Logging
Is there a way to turn on some sort of logging? I am attempting to connect to a db through VB, just learned it and am not sure if I am getting in and not retrieving data or not even getting in yet. Can this be done through the console and then left on?


Copyright © 2005-08 www.BigResource.com, All rights reserved