Jump to content

whit3fir3

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

About whit3fir3

  • Birthday 07/11/1978

Profile Information

  • Gender
    Male
  • Location
    Dallas, TX

whit3fir3's Achievements

Member

Member (2/5)

0

Reputation

  1. Generally you only see that message when the MySQL server disconnects because the connection timeout has been exceeded. In your my.ini set the wait_timeout to something greater that what it is currently to make the change permanent. If you want to make the change with out restarting MySQL you can execute the following: set global wait_timeout=300; The value of 300 is in second so the MySQL server would not disconnect from a connection until 5 minutes had passed. Be careful what you set this value to because if you have your max_connection set too low it will cause connection to stack up and not be released. Thanks, whit3fir3
  2. Sorry if this wasn't explained very well. I try and keep things short and to the point and don't always describe things clearly. The basic design of the tables in question is below: TABLE A ID - VALUE_NAME 1 - Cat 2 - Dog 4 - Bird 8 - Fish Table B is just storing information about people. In this example lets say in TABLE B I have a column named PETS_OWNED. For the first person that column had a value of 5. I would know that the person in question owned a Bird and a Cat as there are no other possible combination of numbers that will give you a value of 5. Now for what I am trying to do there are currently 116 different PETS (for this example) that the person could own and any one person COULD own one of each 116 different pets. The problem I am running into is 2^116 is larger than a UNSIGNED BIG INT and I was just wondering if there is a better maybe even simpler way to accomplish this same thing? Thanks, whit3fir3
  3. There is not simple answer to your question. It all depends on how well MySQL is configured and what kind of hardware you are running on. If you need help configuring MySQL I would suggest running this wget -O - mysqltuner.pl | perl Also I would suggest turning slow query logging on. If you start seeing lots of queries end up in your slow query log that is a good indication that something needs to change on be fixed in your environment. Thanks, whit3fir3
  4. I have a database design that I need to see if I can help point me in the right direction on. In my database I have 2 tables that are related. TABLE A is a list of options that can apply to records in TABLE B. It is a Many to Many type relationship between the two tables. My initial idea was in TABLE A give ID's that were powers of 2. The first record would have the ID of 1, the second record would have an ID of 2, the third record would have an ID of 4 and the 4th record would have an ID of 8. Then in TABLE B I could just store an INT of the sum of the values that apply to the record. My problem is that there are 116 records in TABLE A and 2^116 is a very large number. Over time this number might increase from 116 as well. An unsigned BIG INT in MySQL will not hold an int that large and I really do not want to deal with saving it in the DB as a string and then converting it back to a number before doing the math on it. My question is basically is there a better maybe even simpler way in MySQL to create a many to many relationship between tables like this? Thanks, whit3fir3
  5. Boom.dk As far as posting code the section that is problematic is just a database select or reading from a TXT file. $sql = "SELECT `msg` FROM `email_messages` WHERE `id`=3"; $result = mysql_query($sql); while ($line = mysql_fetch_assoc($result)) { $origEmail = $line['msg']; } What I can tell you from running this through a debugger is that the entire HTML is in the database. A simple command line SELECT verifies and MySQL is returning the entire page as verified by a TCPDUMP. This bring be back to PHP and a 1024 character string limit or some sort. What I can tell you that I found weird is that when looking at the values in a debugger $line['msg'] also only contains 1024 characters. MMDE I try taking the memory limit up, but I really do not think that is going to have the desired effect. The problem I am running into is a limit on a single variable not a resource limitation. I'll give it a shot here in a few minutes and let you know if it works. Thanks, whit3fir3
  6. What I was trying to point out is regardless of where I read the HTML content from (Database or flat file) I still only get the first 1024 characters. I wish the answer was that simple. Thanks, whit3fir3
  7. I need to see if someone can point out something that I have missed or maybe even point me in the right direction on something. I have a PHP script that I have run into a problem on. The basic idea of the script is that it will send out HTML formatted emails to users of my web site. The problem I am running into is storing the HTML content in memory so I can do a str_replace() looking for certain markers in the HTML and replace them with lets say the users name and custom links that pertain to the particular user that the email is going to. Currently the HTML is being stored in a MySQL database, but I have already tried reading it from a flat file. Each time I only get the first 1024 characters returned. The problem seems to be that I am running into a PHP STRING limitation. From the reading that I have done on the subject, the limit should be 1024 characters PER LINE with the variable able to hold somewhere around 8MB worth of data. I can tell you that it does not matter how many \n I put into the HTML I still only get the first 1024 characters. Is there a way I can get the entire HTML file (about 12k characters) in memory so I can work with it and hand it off to the mail function? Thanks, whit3fir3
  8. I have a problem with a MySQL database that started about 12 hours ago that I can not figure out. The short version of the problem is that in a table I have an AUTO_INCREMENT column and for some reason the values in this column went from something in the 12,000 range to something in the 120,000 range. I know everyone's first thought is going to be that the AUTO_INCREMENT was manually set for the table. I can assure that this is not the case as I am the only DBA that has access to this DB and I have gone through my ~/.mysql_history file just to ensure that I did not fat finger something. Now when I do a select on the table and ORDER BY the AUTO_INCREMENT column DESC I see no records between the ones in the 120,000 range and the ones in the 12,000 range. However I do notice that not every record before the 12,000 one is sequential. I had noticed this before and thought it was due to me inserting records and deleting them as part of testing, but that does not seem to be the case any longer. I guess my question is in MySQL what else besides an INSERT or a manual setting of the AUTO_INCREMENT value would case the AUTO_INCREMENT value to increase? Does a record UPDATE cause the AUTO_INCREMENT value to increase even if a new record is not added to the table?? Thanks, whit3fir3
  9. Well there are a couple of things you can do. Depending on the version of Redhat / Fedora / CentOS that you are you can get the packages from yum or up2date. Now this will just download and install RPM packages for your distribution. If I am understanding your post correctly you do not have access to RPM at all which makes no sense as RPM is a very key part of the Redhat distribution. The RPM acronym itself stands for Redhat Package Management. If this is the case and you have no access to the RPM binary then your only other option is to compile from source. My suggestion would be to get RPM working and either get the RPM's via up2date or yum or you can download them from sites like http://www.rpmfind.net/
  10. One minor correction to the above post. In debian the php packages are called php5 not just php. I am sure depending on what you are wanting to do with will want to add some php modules like php5-mysql, or php5-gd.
  11. /etc/httpd/conf/httpd.conf My suggestion would at the bottom of that file put the folllowing Includes /etc/httpd/stubs-enabled/*.conf Then if the directories are not there create /etc/httpd/stub-available and stubs-enabled. Put all your vhosts in the available directory and then just SYMLINK them to the enabled directory. After that reload apache and if you have done it right you should be good to go.
  12. PFMaBiSmAd, Thank you for your quick reply and I am going to try your suggestion, but I do not think that is the solution. In fact I know in my dev environment (running postfix) I can sent the From and Reply-To address using PHP to be anything I want it to be. I guess I just do not understand why I would need a valid mailbox on the system. These are all OUTGOING messages only. The MX records for the domain point to another server, but the server in question in included in the domains SPF record (no that the SPF record has any bearing on my problem). Thanks, whit3fir3
  13. I am having an issue sending messages out from a PHP function and I can not figure it out. I have a development server running Fedora 13 with Postfix for my MTA. I configured postfix and when I send a message and set the FROM headers the email messages appears to come from that person. On my production server I am running CentOS 5.5 with sendmail. It is the same PHP code as I have in my dev environment (that works) so I feel confident in ruling that. Now when the system sends out a message it comes from Apache@mydomain.com. Previously before monkeying with Sendmail some all messages were coming from Apache@localhost.localdomain. Now I have a couple of things I can do as quick fixes for this, but neither are a real long term solution. I can setup user masquerading in sendmail and have the messages that are submitting from Apache appear to come from another user at mydomain.com. The other idea I have thought of is in the /etc/php.ini I in the command for sendmail there I could statically set the FROM address in the php.ini. The problem with both of these option is if I want to send an email message from another user in the future I can't. What I want to know is if anyone knows what needs to be sent (in sendmail I am assuming) to allow PHP to set the FROM address in an email message so that my email messages to do appear to come from Apache@mydomain.com? Thanks, whit3fir3
  14. I have a MySQL question that deal with replications and I am hoping that someone where can help me as I am at my whits end with this problem. Currently I have 2 databases for a site that are in different countries. I have Master / Slave replication setup between the 2 databases and the replications is working great. The database is very large so for backing it up for the time being I am doing a mysqldump and including the --master-data=1 option on the Slave box. Due to the size of the database I currently do not have enough disk space to create a second copy of the DB (this will be corrected in about 2 weeks) on the slave server so Developers have been using the the "Slave" DB for development purposes. What I am trying to do is every night before the backups run restore the previous nights backup and then let the MySQL BIN logs catch the slave up and then finally do a clean mysqldump of the DB. What I am finding is that in my backups on the Slave server the line that starts out "CHANGE MASTER TO MASTER_LOG_FILE" is pointing to a BIN Log position on the slave server. Thus if I let it replay those BIN logs I get both what was sent from the MASTER through the day plus all the changes that the Development team made. My question is this...With running mysqldumps on the SLAVE server is there a way to get the SLAVES position in the MASTERS BIN logs and then when the file is restored reset replication back to that point? Thank whit3fir3
  15. Correct me is I am wrong, but you can only FORK from a PHP script and not from a PHP web page? If so that would explain the setting a value in the DB and then a cron job to check said value and to execute if necessary.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.