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




Properly Re-starting Replication Process


I've just tried to re-start a replication process and the slave's
tables came up marked as crashed. I'm doing a repair on one of them but
there are a lot of databases/tables so I can't check them all (or is
there a table entry somewhere that flags crashed tables?) Here is the
sequence I used: Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Replication Process
I have a Primary PC that acquires data from an external device. This data is stored in a local database.
This external device is sending information all the time.

There is a Secondary PC that copies the data from the Primary PC database. There is another database in the secondary pc. I have to do this with longer time intervals.

I want to:

The secondary pc copies only the new incoming data from primary pc database.

When the secondary pc copies the data, the primary pc has to delete all these copied records (in the local database).
This process has to be repeated continusly.

Using Keys Properly
I have a couple questions on how to properly create keys. Basically i know nothing about them, how they work, how it speeds things up, and most importantly, where to create them to help speed up my tables.

I do have multiple tables that are used and joined together, i just dont know where to make keys. I heard that if you do it improperly, it can slow down your database too?

UPDATE Will Not Add Properly
I have an online comic engine I'm working on, and I just noticed that, as opposed to adding one view (like it should) it will always add two. Can anyone help me out with this? I've already determined it's just this line of code, and that it's not being called twice.

$query = "UPDATE `".SQL_COMICS."` SET comic_views = (comic_views + 1) WHERE comic_id = '".$comic_id."' LIMIT 1";
mysql_query($query) or die(mysql_die_message());
echo($query);

Properly Querying A Relational Db.
I've recently been working with more relational dbs and I was just wondering...am I working with them properly?

The reason I ask is because I'm wondering if there are easier/more efficient/more "proper" ways to be working with a relational db.

So here is an example: two tables, a project table and an employee table. The project table stores employee id in emp_id and is linked to the employee table by a foreign key (a one to one relation).

SELECT P.project_id, E.first_name, E.last_name, P.name, P.code, P.start_date, P.end_date, P.imdb
FROM project AS P, employee AS E
WHERE E.emp_id = P.supervisor
The thing is eventually we'll start to have tables with 4-5 foreign keys and I'm wondering if this is still "proper". Honestly it may seem a stupid question to some of you experts :-p

Getting Utf8 To Work Properly
I have made a few tables in a database, and I'm trying to get my Japanese text to display properly. I have the collation set to utf8_general_ci, and I even added the mysql_query("SET NAMES 'UTF8'"); code into the php page. But even with all of that in, it still won't display properly. The characters show up as セ*チクにんじゃたいけつ and other junk like that.
Now this was working before until I added a second mySQL connection into the page, which inputs the second table. I'm not sure if you can make 2 connections on the same page, but I did and it pretty much messed everything up. I took the second table away, and things were still messed up.
My question is how can I get the Japanese text to display properly? It does display properly on the phpMyAdmin page, but I get garbage on the actual page.

How To Install Mydsl Properly
is there a step by step guide for installing mydsl properly and creating a databse?

Search Does Not Match Properly
i had created a search function on a web application.

the problem is, i try enter some of info to it, certain text can be found but certain text can be match although they are in database.

this my query:

$keywordu = strupper($keyword);
$keywordl = strlower($keyword);

$sql = "SELECT E.* FROM employes AS E, dvi_problem AS DV WHERE AS.empId = DV.empId AND (E.emp_name LIKE '%".$keyWordl."%' OR DV.reference LIKE '".$keywordi."''%".$keywordl."%' OR E.emp_name = '%".$keywordu."%' OR DV.reference LIKE '%".$keywordu."%')"

$query = mysql_query($sql, $db) or die('Fail to search.');

i test with direct copy the data from database, some string i copy can search it but some other string i copy direct it can work wo...

i try show out the variable $sql value, it show with not error, the keywordu n keywordl aslo show out the value when i print out the $sql variable.

Mysqld Is Not Running Properly
I have installed mysql server & client version 3.23.54a from Redhat installation 9.0. I could install the RPM 's with out any problem.

I can see 'mysqld' program . But when I run it shows a message like mysqld started [ok].When I checked 'ps aux' , I could not see any process running with mysqld. Also I could not run any programs like mysqladmin etc. All of them fail. does anybody know what is the mistake ? What should I do ? Also when I try to stop mysqld it fails.

Designing Databases Properly
After what seems like far too much agonizing, I think I've decided to build my own php "shopping cart" and hack my own interface to paypal IPN, because all the other solutions I've come across are massively oversized and overdeveloped for my needs.

But I could use some help in setting up the structure. I'm not sure of the best way to handle "options" with my various products.

First of course I set up a basic database with product fields like:
sku, price, name, etc. etc.

The tricky part is that some products will have special options, some dropdowns and some text fields, and I know I won't be able to predict all these in advance, like:
item color, accessory color, font, initial, initials ...

In addition, some products will call for extra product photos and others won't ...

And then I will need some way of storing all these extra options for a given customer's order when it comes through.

Extended-insert Not Working Properly
I am having a problem with using the --extended-insert option when using mysqldump.As I understand it, this option creates multiple insert statements within the .sql file for tables that contain more than 1 row of data.

According to documentation I have found, this substantially speeds up the restoration process.The main database I am concerned with uses the InnoDB engine, however I also want to backup the mysql database as well (which, to my knowledge, uses the MyISAM engine).

However, when I execute the database dump using this option, there is only 1 insert statement, and all values are seperated by commas.When trying to restore my databases, this causes my system to eventually freeze up due to the inefficiency of inserting multiple rows this way.I am using Windows XP, 1.8 Ghz, 512 MB of RAM.

The command I am issuing is as follows:

mysqldump --opt --single-transaction --u root --all-databases > "C: estbackup.sql"

I have also issued the following command, with the same result:

mysqldump --extended-insert --single-transaction --u root --all-databases > "C: estbackup.sql"

Storing Large Integers Properly
I am storing book isbn numbers in a table. isbn numbers are 10 digit
numbers and many start with 0. The data type of the field I am storing
this info in is a bigint(16) unsigned.

It appears that isbns that start
with 0 are going in as 9 digit numbers, the 0 is being ignored or
stripped. I have experienced this before with integer data types
ignoring leading 0s. I'm wondering how to address this? Should I
change the field to a varchar or char data type?

Two Digit Numbers Not Formatting Properly
I have a table I am using to populate drop-down menus. It is for languages.
each language has a specific code that must be saved to the field in question.They work fine except for two codes: 00 and 01.
I can't change the codes to anything else. They have to be 00 and 01. THey are saving to the spreadsheet as 0 and 1 however.

Inserting Dates Properly Formatted
I have a dataset that has all it's date formatted as MM/DD/YYYY. I want to be able to insert this into a table that is using a field set as 'date'.
How would I go about properly formatting the MM/DD/YYYY to insert into the table?
Right now when I insert I end up with all the dates storing wrong. IE: 9/6/2005 stores as 2009-06-20.

Mysqlcheck: Clients Are Using Or Haven't Closed The Table Properly
I'm using the command mysqlcheck --all-databases --auto-repair --silent
and I see these warnings (listed below) on a daily occurrence. Is mysqlcheck
causing these warnings? I can't see how a table can close inappropriately.
How can I prevent this.

Hoping to here from MySQL users who have came across this. I'm using MySQL
4.1.11 on RHEL. Code:

Getting Text Retrieved From Mysql To Fit Tables Properly
I have been working on a really simple mysql/php set of pages.

Page 1: Input 3 peices of data (Title, Date and Text)

Page 2: Display all news that has been inputted

I have it working, except for one problem. My website is built with html, and tables. I want it so that when the text gets to the edge of the table, it drops down a line and starts again on the next line - so it doesn't carry on and on.

Theres no problem with title and date - they're just a few words, but the text part of the news is usually 5 or 6 lines long. This means that it wont all fit on one line without ruining the entire website display. Code:

Can I Optimize This Process?
I have a script that reads data records from MySQL and creates a table of all the records and their subsequent data for viewing. Each page of the script will only show 10 records, but with over 10,000 records, there are many many pages of records... thus I have pagination links at the bottom.

Now for the pagination to work correctly, I have to count the total number of records in the specified query, but to display only the 10 records per page, I have to run the same query a second time and add the LIMIT clause with start and display limit parameters. So right now I am calling the same query essentially twice, only the second time I specify the LIMIT clause. These queries are rather huge with multiple joins and many many columns of data.

Is there any way I can optimize this process and get the total record count of the specified query for pagination purposes, but also be able to limit the start and display count for each page as aforementioned. Or is this something I just have to use 2 seperate queries for?

Why Process Are Sleeping?
I've seen lots of queries which are sleeping with SHOW PROCESSLIST.
Why are they sleeping?

How can I prevent this sleeping queries? Because I can't running lots
threads at the same time therefore I would prefer have none queries
like that.

Why Process Are Sleeping?
I've seen lots of queries which are sleeping with SHOW PROCESSLIST.
Why are they sleeping?

How can I prevent this sleeping queries? Because I can't running lots
threads at the same time therefore I would prefer have none queries
like that.

Indexing Process
Is there a way to check the current status of the indexing process
in MySQL [Ver 12.21 Distrib 4.0.15, for apple-darwin7.2.0 (powerpc)]?
I am indexing a huge database and I would like to have an estimation
of the end of the process.

Is the indexing time linear or should I expect any special delay?

Mysql Process
I am working on bulk mailing panel.
I want to send 70,000 mails to the member

I am using following process for sending the email id to the members:
fetch the email id;
send email;
change the flag;
Next email id;

But this mysql process taking log time.

Is there any way, to control it the process or stop the process for some time and resend it again.

Output Process
I need to send MySql database records to another database via HTTP post to be interpreted by a post action script. It needs to appear as if the data came directly from an HTML webform. It would have to be a realtime post as the records are inserted into my database. Any idea what kind of process would have to be developed to make this happen?

Indexing Process
Is there a way to check the current status of the indexing process
in MySQL [Ver 12.21 Distrib 4.0.15, for apple-darwin7.2.0 (powerpc)]?
I am indexing a huge database and I would like to have an estimation
of the end of the process.Is the indexing time linear or should I expect any special delay?

Select And Insert In One Process?
hi there, sorry if this sounds like a newb question - it is. please be gentle

i have created a registration form using php which allows users to enter their info into a table called "retailer". one field entered is a postcode.

there is another table, "domicile" which contains every postcode in the country as well as the mail centres that service each post code. there are say 10 postcodes per mail centre.

during the registration process, i need a function that will use the postcode entered to look up the name of the relevant mail centre (from "domicile") and then store that name in the table "retailer" under the locale column.

i can get the result i need with the query

SELECT locale FROM domicile WHERE pcode=5555 LIMIT 1
where 5555 is the postcode. I am unsure though, as to how to properly implement this into my php code.

PHP

$physical_pcode = $_POST['physical_pcode'];
$locale = @mysql_query('SELECT locale FROM domicile WHERE pcode=$physical_pcode LIMIT 1');

$sql = "INSERT INTO retailer SET
physical_pcode='$physical_pcode',
locale='$locale'";


but the field remains empty. Maybe I need to break this up into separate parts?

Associating A Query With A Process
Is it possible to find out which MySQL query is associated with a particular server process?

Some mystery query on our server is causing massive CPU usage issues that last for upwards of 5-10 minutes.

Unfortunately this query is not showing up in the MySQL slow query log. In fact, the problem usually doesn't start until after all the PHP code that utilitizes the queries is finished executing. That's usually the point where MySQL goes postal on the system resources.

MySQL Development Process
I am a student working from a university and at present part of my research involves figuring out the development model for MySQL. Who actually does the coding for MySQL and if MySQL development is open to all how does one get involved?

Beginner Development Process
Whats the best way to develop mySql database to live server?

I've work for many years with Access file based database and development was pretty straight forward:

1. design, develop, and test database on local server.
2. after fully tested, ftp up to live server.

When comes to mySql management system, I'm not sure how to proceed. I've downloaded and learned how to use the control center and admin interfaces. I've even taken tutorials working at the command line. While this is all good its still all local how the heck do i get it up to a live server. I've read you can use admin tool to dump the data out, but once you've done that what do you do with it? And once you have it up to the server how do you get it back to your machine to back it up or work on it?

Process Getting Locked Occasionally
We are using MySQL 5.0.22 with PHP 5.1.4 on Apache 1.2.2. The OS is Red Hat EL 3.0 with cluster suit. The application is a call center management system. We are intermittantly getting the error 1203 (Too Many User Connection) while connecting to the database. If we restart the Apache then things become ok. Otherwise, the users are unable to connect to the database. While doing a show process at the time it happens we find that a number of processes are in locked state. But the MySQL server is running and we can connect it with phpMyADMIN. We are using MyISAM tables and we are using replication of the database as well.

The max_user_connection is set at 200. The hardware is having 2GB RAM and is running only MySQL. As we are not knowledgable enough, may be we are missing some information that we should have posted. Kindly let us know and we shall post all the required information.

MySQL Process Terminated
wanted to put this together with an earlier thread of mine...although I decided to split it coz it seems this issue might not be related to my earlier thread on maximum memory MySQL can use in Windows 2000..

We have had a number of incidents lately in which the MySQL process terminated unexpectedly, and did not restart. Logs were enabled except the slow and general query log. But whenever the process terminates, there's totally nothing in the logs regarding what's the cause of the crash...it does not even mention a shutdown. Was wondering if anyone encountered this before? Hope to hear your experience on this and perhaps a tip or two on what to look at next?

Process Running Long
2874 mysql 24 0 143m 132m 3756 S 0.0 6.5 1296:37 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-
6 root RT 0 0 0 0 S 1.2 0.0 47:31.78 [migration/2]
3188 mysql 16 0 143m 132m 3756 S 0.0 6.5 9:55.19 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-


Is there any way I can prevent this? This server just has forums on it and thats it. It seems its a runaway process or an orphaned connection. Is there any way to have all processes killed after a certian amount of time like php has in its config file.

Process Table Is Empty
We use MySQL 4.0.13, Redhat 7.3(kernel 2.4.18.3). Apache 1.3.27
Mysql is alive and there are process but I don't see in ps (process
table) and very slow web receive.

So Many Child Process Of Mysqld (version 4.0.21)
I upgread mysql 3.23.56 to 4.0.21, succesfully upgraded. But, I
observed abnormal behaviour of mysql (or may be i dont know). Thing
is, in mysql 3.23.56 when I start service, only one procses exist [
check thru command ps -A | grep mysql* ] but when I upgraded to mysql
(4.0.21). Above command shows me 25+ mysqld child process. Is this is
correct or any problem. Logs [/var/log/mysql.log] shows me successful
start/stop.

Importing Databases - Low Priority Process
I'm looking to do a large database import, roughly 500mb. However i want the import to be done at a low priority, IE slowly so it doesnt consume massive server resources.

I'm importing on a Windows 2k3 server and am trying to minimize the impact to my other hosted sites for the duration of the database import. I intend to use the following command for the import mysql.exe -uXXXX -p database < file.sql

Is there anyway that i can establish a resource priority to the operation?

Mysqld Process Running High CPU
My Mysql server is running at around 60% CPU even
when there's virtually no queries going through -
I turned on logging and have been watching the
queries and looked at mysqladmin processlist but there
is nothing unusual - this just started happening.
I tried using myisamchk which didn't find any
problems with my tables.

Table Locks A Process Is Waiting On
I'm having a lock of locking on the MyISAM tables on my forum, and so I'd like to know which tables are responsible for the blocking of the threads, so I can convert those specific tables to Innodb.

Preventing Runaway Mysqld Process
I would like give users the ability to experiment with complex queries but
I'm worried about them creating queries that will bog down the server.

Mysqld Runs Single Process
I've just installed MySQL 4.1.10 on RH ES 4 from the Redhat RPM and for some reason it's only running a single process. I haven't used mysql for quite a while and I used to remember it running around 8-10 processes.

The other unusual thing is that in 'top' the process hardly shows any cpu time (under a second) even though our server is quite heavily loaded.

I've checked the my.cnf and log files and it doesn't seem to be running in debug mode.

Finding Information About A MySQL Process/query ID
How would I go about finding more information about a mysql process/query ID, i.e. from "SHOW PROCESSLIST"? I have some queries on "Sleep" with a time of over 500 seconds (really bad!) and I want to figure out what's causing them.

ALTER TABLE And Logging Updates During Process
The documentation states that the ALTER TABLE works by making a temporary copy of the original table. The alteration is performed on the copy, and then the original table is deleted and the new one is renamed. While ALTER TABLE is executing, the original table is readable by other clients.

So that makes complete sense and is logical. But it then goes on to say,

"Updates and writes to the table are stalled until the new table is ready, and then are automatically redirected to the new table without any failed updates."

I'm hoping somebody can shed some light on '...are stalled until the new table is ready...' I assume MySQL is storing these writes somewhere, either in a memory queue or perhaps on disk but I'm not sure. Actually Where it stores the information in this Gap?

Process/Product To Display Contents Of Database Via PHP
I am designing a MYSQL database. I am looking for a simple process or product to display the contents of the database via PHP. To be specific: It will contain a list of articles and their URLs.

I want to be able to select by the subject, then all articles by that subject will appear (perhaps 20 at a time). There should be a "NEXT" and a "PREVIOUS", and if you should click on the article (i.e. its hyperlink), you will go to that article. Any thoughts about this?

Dynamically Settings MySQL Process Priority
I have written a very complex and highly CPU intensive PHP script that relies on numerous complex MySQL database calls. As this script takes nearly 48 hours to finish execution with a large database, and will sometimes be run on a live server, I need to be able to dynamically adjust the process priority of the script's MySQL thread from within the PHP code if other server activity must be given priority.

Here is my question, and I know this may sound ridiculous, but is it possible to do this without having to resort to the usage of PHP's Process Control Functions? Unfortunately this is a shared host so those will not be enabled.

Microsoft Jet Database Engine Stopped The Process
I only get this message when the tables are linked to mysql for an MS Access 2000 database.

"The Microsoft Jet database engine stopped the process because you and another user are attempting to change the same data at the same time. "

Multiple Many To Many Relationships Within A Heirarchical Selection Process
I have run into an interesting problem in having to develop a group of tables with an odd relationship set. I'll give you an idea of what it is:

- I have 4 tables (3 contain classifications and the 4th contains the record's information)

- the information for the end-user is taken from the 4th table based on selections made from the 3 tables

- assume that each of the three tables contains a many-to-many relationship with the other two, i.e. a member of the third class can be a member of multiple second and first classes

- the ideal selection process will go:

select first(if second choices exist then select second, else display results from 4);
select second(if third choices exist then select third, else display results from 4);
select third(dislay results from 4).

I am currently trying to implement this with 3 tables containing a class name and id then 2 linking tables between 1 and 2, and 2 and 3 referencing the class id's to denote the many to many relationships. What I'm not sure on is how many columns to use to categorize the records in the 4th table, or which to refrence them to, because they should be able to be accessed from any one of the three steps. If in fact the best idea is to have a foreign key in the 4th column for each of the other 3 tables then how would a many to many relationship actually be implemented? Also, it seems to me like there might need to be another linking table between 1 and 3 in case something from the third class resides under multiple first classes but only a single second class.

Debian Mysql Autostart: Line 159: Kill: (####) - No Such Process
I've just recently compiled MySQL 5.0.41 on a Debian box, and am trying to install the init script. I've copied support-files/mysql.server over to the /etc/init.d directory and set up the symlinks, but cannot seem to run it.

Running: /etc/rc3.d/S90mysql start displays:
Starting MySQL/etc/rc3.d/S90mysql: line 159: kill: (8076) - No such process ....

Just Starting
I'm interested in developing an application using MYSQL. I've been out of the developer market for quite a while, but my background is mostly Oracle based technology with a lot of exposure to object, Java and XML.
What tools are in favor these days for use in...
1 - Modeling an application (data, object, process, services....) as well as generating the application.
2 - End user design for web based applications
3 - Administration tools to monitor what's going on
4 - Debugging tools
5 - Documentation

How To ORDER BY DESC Properly. It Makes 150 Before 50 If ASC Order!?
I have this list:
50
150
200
250
300
350
400
450
500

If I order it by ASC order then mysql results this:
150
200
250
300
350
400
450
50
500

What the hell ?? How do I order it properly?

Int Field Starting With 00
I have a database and in the one table I have a field where I want to insert a numerical value starting with two zeros and then numbers after. I have tried INT and VARCHAR and both eliminate the 00 in the front and give me the rest of the number when I insert them. Why is this?


Starting Auto_increment At Zero
Can an auto_increment field be started at 0? Javascript counts from 0 and I would like to not have to subtract 1 from the numbers I get out of my table. If anybody knows how to start things at zero that would be cool.

Starting MYSQL On A Mac
I feel quite stupid I cannot seem to get MYSQL to even run on my Mac (OS X 10.4)

I have installed MYSQL and then went to terminal and entered

cd /usr/local/mysql

then

sudo ./bin/mysqld_safe

then my password as prompted

which is followed by

Starting mysqld daemon with databases from /usr/local/mysql/data

- at this point as it just seems to stop

What next? I have tried entering mysql -u grifkerry -p but nothing happens! I have left it for a while but still nothing.

Starting MySQL
I need to transfer a database from one computer to another. Both computers are Macintoshes running OS X Panther. Both computers are running MySQL through localhost. The computer to which I am transferring the database has MySQL up and running perfectly fine.

The computer from which I want to get the database is able to query the database through a web application using Perl but when I try to run MySQL from the Unix command line using the following text: "mysql -h localhost -u root -p" I get the following response "-sh: mysql: command not found."

As far as I know, MySQL is installed correctly on this machine (I would assume it has to be in order for the web application to access the database through Perl and MySQL). If I can start and run MySQL, I know that I can dump the database using the "mysqldump" command. Does anyone have any suggestions on what I need to do to get the mysql command to execute correctly so that I can run the program?


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