|
-
Intranet/Apache/IP issue
Date: 08/01/07
(Web Development) Keywords: php, mysql, browser, sql, apache
ok, this is getting posted a few places because I'm head/desk-ing all over the place on it.
Have Intranet, Intranet is based around an OS X Mac running Apache/PHP/MySQL. Was working fine, OS X server (just regular OS X but the machine is designed to work as a server) was at someone's house. Worked fine with the IP it had there and everything pointing to it, which was actually the IP of the router it was connected to I believe. This was the ServerName address in httpd.conf . Server moved to small office, BOOM.
Updated the ServerName value in httpd.conf to the proper IP for the machine, however if you try and go to that IP (how the intranet works there, via the browsers connecting to that ip then going where they need to from the index page there) it gives a "Forbidden" error (don't think it's even a 403) and says that you don't have permission to connect to the OLD IP address. I don't understand this, we even disconnected it from the internet to see if it was even actually trying to connect to that IP and no, same error. Anything else and it says it cannot be reached when the uplink is disconnected, so definitely a problem on the server somehow. On top of that, localhost and 127.0.0.1 will work, the machine will reach out to the internet and can be mounted in internet explorer with the \\servername\path\etc., however this won't let us access the PHP processor to display the pages, just the files themselves.
Is there anywhere else that a problem like this could lurk? Just uninstall Apache and re-install? I've never removed Apache from a machine or done a make of apache or anything else on a mac so I'm not exactly sure how to if that would even help. Really don't understand what's going on and I need to get this up ASAP. :( Any help please? Will repay in kind somehow, not monetarily but somehow (work, knowledge, something).
Thanks!
Cross posted all over sort of.
Source: http://community.livejournal.com/webdev/425477.html
-
Intranet/Apache/IP issue
Date: 08/01/07
(PHP Community) Keywords: php, mysql, browser, sql, apache
ok, this is getting posted a few places because I'm head/desk-ing all over the place on it.
Have Intranet, Intranet is based around an OS X Mac running Apache/PHP/MySQL. Was working fine, OS X server (just regular OS X but the machine is designed to work as a server) was at someone's house. Worked fine with the IP it had there and everything pointing to it, which was actually the IP of the router it was connected to I believe. This was the ServerName address in httpd.conf . Server moved to small office, BOOM.
Updated the ServerName value in httpd.conf to the proper IP for the machine, however if you try and go to that IP (how the intranet works there, via the browsers connecting to that ip then going where they need to from the index page there) it gives a "Forbidden" error (don't think it's even a 403) and says that you don't have permission to connect to the OLD IP address. I don't understand this, we even disconnected it from the internet to see if it was even actually trying to connect to that IP and no, same error. Anything else and it says it cannot be reached when the uplink is disconnected, so definitely a problem on the server somehow. On top of that, localhost and 127.0.0.1 will work, the machine will reach out to the internet and can be mounted in internet explorer with the \\servername\path\etc., however this won't let us access the PHP processor to display the pages, just the files themselves.
Is there anywhere else that a problem like this could lurk? Just uninstall Apache and re-install? I've never removed Apache from a machine or done a make of apache or anything else on a mac so I'm not exactly sure how to if that would even help. Really don't understand what's going on and I need to get this up ASAP. :( Any help please? Will repay in kind somehow, not monetarily but somehow (work, knowledge, something).
Thanks!
Cross posted all over sort of.
Source: http://community.livejournal.com/php/578944.html
-
Error 1005
Date: 08/02/07
(MySQL Communtiy) Keywords: mysql, database, sql, microsoft, google
This one's got me at the end of my rope, and none of the answers I'm finding searching in the many places I've searched have given me any help, so I'll ask you guys.
First off: I am brand new (as in a couple of weeks) to MySQL, after moving to Ubuntu (Feisty) at home. (Goodbye Microsoft.) I'm a SQL Server DBA/DWA/Database Developer/jack-of-all-trades at work, so I do have some DB experience, just not with MySQL.
Anyway, I've created a schema and the tables in it. Now I'm trying to relate those tables. All use the InnoDB engine.* The guinea pigs I'm using are the BOOK and AUTHOR tables, and I'm trying to relate the ID field in AUTHOR to the AUTHORID field in BOOK. (And, yes, I've tried changing the name of ID to AUTHORID with no success.) Both are type INT. ID/AUTHORID is an ident-seeded primary key. AUTHORID in the BOOK table is a foreign key. Or it's supposed to be, but when I try to relate them, I get the infamous error 1005 (can't create table './directory/filename.frm'). I've found extensive discussion on this at ubuntuforums, forums.mysql.com, and a number of blogs, and have checked everything I've found, modified everything I can, and I still get the error. Basically, if you search on "error 1005" on google and check the first 150 non-repeating pages that come up, I've tried/checked everything that comes up to no avail. I'm at a loss for what do do next, and hoping someone has some ideas.
Also, I tried running a MySQL instance on my XP machine at work, created the exact same tables the exact same way, and tried the relation. It worked on the first try without a hitch.
If anyone's got some help, I'd be truly grateful. Thanks. If more info is needed, I'll report back tonight when I'm actually sitting at my Ubuntu machine.
* As a side note, for philosophical purposes only: why are there so many available engines that don't support foreign keys? Do that many people create non-relational databases? Just wondering.
Source: http://community.livejournal.com/mysql/117098.html
-
Can mySQL take it back?
Date: 08/12/07
(Open Source) Keywords: mysql, sql
What is happening is that mySQL FOSS and mySQL open source are now different products.
Source: http://feeds.feedburner.com/~r/zdnet/open-source/~3/143406695/
-
search function
Date: 08/13/07
(WebDesign) Keywords: mysql, html, database, sql
Is it possible to create a search function without using database?
If I design a site that's purely HTML, can I add a search function? There will many products on the page, and I want the user have the ability to search item name and list the page.
I wish I know MySQL and write backend. This is hard for me, probably will rely on frontpage extension.
Source: http://community.livejournal.com/webdesign/1294641.html
-
Is Oracle’s latest spin actually right?
Date: 08/14/07
(Open Source) Keywords: mysql, sql, postgresql
Are mySQL, PostgreSQL and Ingres really better than Oracle, because they are continuing to gain share. Or are their gains down, at least in part, to the fact that they're open and free?
Source: http://feeds.feedburner.com/~r/zdnet/open-source/~3/144042624/
-
counting up yes votes?
Date: 08/20/07
(WebDesign) Keywords: php, mysql, database, sql
I have a mySQL database, and one of the tables is used as the backend for a ratings system in which people can rate images on a scale of 1-5. In it, I have columns for the following data: id (a primary key field), userid (their phpBB userid), total votes cast, and then a column for every item in the rating system, just as a y/n toggle to check whether or not a person has rated that item. Actual scores are stored elsewhere.
My problem is fairly simple: I need to clear some of the ratings, because the images are going to change. How can I count up the total number of 'y' in a row in my database in order to update the total votes to reflect that some votes have been reset? Each row represents one user's votes, so it might say that user 1 has voted on images 1, 3 and 5, but not 2 and 4. I want to be able to find out that user 1 has voted 3 times. mysql_num_rows, of course, just returns 1, and I think mysql_num_cols/columns doesn't exist. Right now, the system simply works that every time a user rates something, the total vote is incremented by 1. Does anyone know what I need to do?
Source: http://community.livejournal.com/webdesign/1298510.html
-
Reparo WordPress MySQL Comment Table…Why?
Date: 08/21/07
(Java Web) Keywords: mysql, sql
Nowadays my WordPress comments table is frequently getting corrupted and I have to repair it. The MySQL table repair command does the trick. However it is bothering me. I am suspecting there are multi-threading issues with WordPress comment processing code which is triggering as I am having huge load recently. I wonder if other bloggers [...]
Source: http://blog.taragana.com/index.php/archive/reparo-wordpress-mysql-comment-tablewhy/
-
WordPress Server Load Problem: Cause & Solution
Date: 08/23/07
(Java Web) Keywords: mysql, sql, spam
I was watching the mysql queries using mytop just before our server went down. In a flash I realized the cause of our persistent server load problem. I have also come up with an elegant solution which I will implement in the next few days.
The problem is due to huge spam comment load on my [...]
Source: http://blog.taragana.com/index.php/archive/wordpress-server-load-problem-cause-solution/
-
Another quickie
Date: 08/23/07
(PHP Community) Keywords: php, mysql, sql
Hello!
Just another quick question from me to you.
I simply need a little clarification on the mysql_insert_id() function that is available in PHP.
The definition on PHP.net reads: "Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query." Is this ID the number that is created in a column I defined (with Auto increment enabled) or is this something else entirely?
Say I have a table with two columns: Column 1 = id_num (auto increment) Column 2 = name
I want to insert a new name into the table and let the value for id_num generate automatically. Easy, right? Can I then call the mysql_insert_id() function and have it return the value in the first column that was created, or does it return a value that mysql uses but nobody else would need?
Source: http://community.livejournal.com/php/581426.html
-
PHP Install problems
Date: 08/29/07
(PHP Community) Keywords: php, mysql, html, sql, apache
I've wrecked my setups enough times to be a pro at getting PHP, Apache, MySQL and Windows XP to all play together nicely. However, this time I'm running into a strange problem. I've got PHP 5.2.3 and Apache 2.0.59. Apache runs fine, PHP seems to run fine, phpinfo() shows everything as it should be. When I try to load anything that seems to have more than a single line in it, it doesn't look like it's parsing anything. I get a lot of broken bits of code showing on the screen. Things like '>' when used as operators are being parsed as HTML tags. These are scripts that ran fine on Sunday with Apache 1.0.3 and PHP 4.whatever. I'm having trouble deciphering exactly what it's doing or why, but it's obvious it's not working. I'm at an end here, for now. Anyone have any suggestions?
EDIT: Found it after staring at a script for half an hour. Know what it was? From PHP.INI:
short_open_tag = On
That was set to off. Of course I'm lazy and never actually type to start a script, however, my editor sometimes puts that in for me, which is why some scripts worked. I'd read about this setting, but never thought it might apply to me.
Source: http://community.livejournal.com/php/582157.html
-
Updating multiple tables with JOINs
Date: 08/31/07
(MySQL Communtiy) Keywords: php, mysql, sql
I have tables used for storing product information. When product information is updated, I need to archive the current data before updating. I could extract the data with PHP and insert in the Archived Stuff tables, but I'm trying to find a way to do this with Insert/Update queries directly (without Selecting everything with PHP).
Btw, MySQL table export (in plaintext) is under the LJ-cut section below, for your convenience.
A user is updating a record - before touching the current data I want to back it up into the Archive tables:
INSERT INTO archive_stuff_general (stuff_id) VALUES ($stuff_id);
SELECT LAST_INSERT() as $archive_id
INSERT INTO archive_stuff_colors (archive_id) VALUES ($archive_id);
INSERT INTO archive_stuff_textures (archive_id) VALUES ($archive_id);
Now I want to use an UPDATE statement to copy the current data to the archive tables.
UPDATE archive_stuff_general t1 LEFT JOIN archive_stuff_colors t2 ON t2.archive_id = t1.archive_id LEFT JOIN archive_stuff_textures t3 ON t3.archive_id = t1.archive_id LEFT JOIN stuff_general t4 ON t4.stuff_id=t1.stuff_id LEFT JOIN stuff_colors t5 ON t5.stuff_id=t4.stuff_id LEFT JOIN stuff_textures t6 ON t6.stuff_id=t4.stuff_id SET t1.user_entered = t4.user_entered, t2.color = t5.color t3.texture = t6.texture WHERE t1.archive_id = $archive_id
If you haven't noticed already, here is where I am stuck.
If there are multiple archived records with the same stuff_id, that update statement updates -all- of the records, not just the
one with $archive_id. This is because of the third LEFT JOIN, where I join the archive to the stuff tables.
Is there a way to do what I'm wanting to do? Or should I just do it the old fashioned way and SELECT via php, loop through
results and insert into the archive table?
CREATE TABLE `stuff_general` ( `stuff_id` int(3) NOT NULL auto_increment, `user_entered` varchar(10) NOT NULL, PRIMARY KEY (`stuff_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
CREATE TABLE `stuff_colors` ( `stuff_id` int(3) NOT NULL, `color` varchar(20) NOT NULL, KEY `stuff_id` (`stuff_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `stuff_textures` ( `stuff_id` int(3) NOT NULL, `texture` varchar(10) NOT NULL, KEY `stuff_id` (`stuff_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `archive_stuff_general` ( `archive_id` int(3) NOT NULL auto_increment, `stuff_id` int(3) NOT NULL, `color` varchar(20) NOT NULL, PRIMARY KEY (`archive_id`), KEY `stuff_id` (`stuff_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE TABLE `archive_stuff_colors` ( `archive_id` int(3) NOT NULL, `stuff_id` int(3) NOT NULL, `color` varchar(20) NOT NULL, KEY `stuff_id` (`stuff_id`), KEY `archive_id` (`archive_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `archive_stuff_textures` ( `archive_id` int(3) NOT NULL, `stuff_id` int(3) NOT NULL, `texture` varchar(10) NOT NULL, KEY `stuff_id` (`stuff_id`), KEY `archive_id` (`archive_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `stuff_general` (`stuff_id`, `user_entered`) VALUES (1, 'jane'), (2, 'john');
INSERT INTO `stuff_colors` (`stuff_id`, `color`) VALUES (1, 'green'), (2, 'blue');
INSERT INTO `stuff_textures` (`stuff_id`, `texture`) VALUES (1, 'smooth'), (2, 'sandy');
Source: http://community.livejournal.com/mysql/117672.html
-
How To Test Master-Master / Master-Slave / Standard / Circular Replication on MySQL
Date: 09/01/07
(Java Web) Keywords: mysql, sql
Working with replication systems is not easy. Learning and testing different kind of MySQL replications and fine-tuning it to your specific needs is a time-consuming endeavor. Also you need to have several MySQL servers at your disposal. To overcome these limitations, Stardata created a MySQL 5 Replication Playground, a painless installation of 4 replicating nodes [...]
Source: http://blog.taragana.com/index.php/archive/how-to-test-master-master-master-slave-standard-circular-replication-on-mysql/
-
Tip: How To Find MySQL Version
Date: 09/01/07
(Java Web) Keywords: mysql, sql
Try:
mysql -e status|grep ‘Server version’
If that doesn’t work then use:
mysql -u root -p -e status|grep ‘Server version’
Provide root password when prompted. Default root password for MySQL is empty string, so just pressing enter when prompted for password will suffice by default.
Windows users should simply run:
mysql -e status
or the equivalent with login specified and then look [...]
Source: http://blog.taragana.com/index.php/archive/tip-how-to-find-mysql-version/
-
MySQL Master-Master Replication…
Date: 09/02/07
(Java Web) Keywords: mysql, database, sql
Have you tried Master-Master replication (bi-directional slave-master replication) for MySQL? I am finding myself in a position where I need to have this replication to support the load on my blogs and sites.
I would very much appreciate if you can share your experience & suggestions with master-master replication of MySQL database.
I don’t want to [...]
Source: http://blog.taragana.com/index.php/archive/mysql-master-master-replication/
-
Two MySQL Questions.
Date: 09/05/07
(PHP Community) Keywords: mysql, sql
1.) I'm trying to build a Query where you have condition 1 which is absolute (like foo = 'Bar') but then condition 2 which could have several options. This is how it looks:
WHERE company_name = 'FOO' && entered_by = 'BOB' || entered_by = 'JOE' || entered_by = 'KAT'
What it is 'supposed' to do is pull up any records with company name of FOO that were entered by BOB, JOE, or KAT. But instead it's just pulling up all records entered regardless of the company_name restriction. What am I doing wrong here?
2.) Some of the company names use a & symbol which is wreaking havoc on the query. I've tried to use mysql_real_escape_string and addslashes but neither solve the problem; leaving a company name like R&F Cola reduced to a query search of R. How do I get MySQL to accept that the & is just part of the query?
Thank you so much to anyone who helps. I'm sure I"m missing something easy; but those are usually the most annoying ones!
Source: http://community.livejournal.com/php/583537.html
-
It's the simple things in life...
Date: 09/06/07
(PHP Community) Keywords: mysql, css, sql
Most of you are probably already doing this. But you never know.
Function to call to mark up table rows with CSS
// odd_even
// marks up table rows odd or even
// returns string to echo
function odd_even ($count) {
if ($count & 1) {
return ' class="odd" ';
} else {
return ' class="even" ';
}
}
And then...
$count = 0;
while ($row1 = mysql_fetch_array ($result1, MYSQL_ASSOC)) {
$count++;
echo ' ** table row data ** | ';
...etc
Until I thought this little guy up I've been stupidly sticking the same routine in manually each time. It's the little things I often overlook.
Source: http://community.livejournal.com/php/583773.html
-
phpmyAdmin incosistency with the command line
Date: 09/10/07
(MySQL Communtiy) Keywords: php, mysql, sql
I am puzzled by the following issue. I run MySQL on my personal computer (Windows) and use phpMyAdmin to work with it. However, every attempt to use COUNT - produces the syntax error. phpMyAdmin doesn't recognize COUNT as a command. Moreover, every time I try to use tbl_name.field_name instead of just field.name I get the syntax error as well. However, if I copy exact the same SQL code (Copy/Paste) to DOS command line - everything seems to work great. How can it be at all? Does anybody have an idea? Thank you. Windows XP, PHP 5.2.0, MySQL 5.0.27, PHPMyAdmin 2.9.1.1 Installed EasyPHP 1. 8
Source: http://community.livejournal.com/mysql/118843.html
-
MySQL to get dynamic load balancing in 2008
Date: 09/13/07
(Open Source) Keywords: mysql, software, database, sql
MySQL will introduce dynamic load balancing to its database platform and enterprise subscription in 2008.
That news surfaced during a briefing Thursday with MySQL executives about the open source database company’s forthcoming 5.1 and 6.0 upgrades.
Zack Urlocker, Executive Vice President of Products at MySQL, said the load balancing software will ship as part of the next [...]
Source: http://feeds.feedburner.com/~r/zdnet/open-source/~3/156072251/
-
max_user_connections problem
Date: 09/15/07
(MySQL Communtiy) Keywords: php, mysql, database, sql
I have a recurring problem with my site. It gets to max_user_connections very quickly. In php they advised me to make rapid-fire connections, and it works better than before, but it still builds up regularly. My host says that sometimes queries block the server. This is now a really serious problem and I'm in trouble with my host.
This happens since I tried to normalize the database by splitting information on other tables, instead of having fields with comma-separated lists. Thing is, now some query require several JOIN to get all the necessary information. Example:
$info_query = "SELECT $stories_table.id, $stories_table.series_id, $stories_table.story_num, $stories_table.story_title, $stories_table.pairing_extra, $stories_table.characters_extra, $stories_table.rating, $stories_table.spoilers, $stories_table.challenge, $stories_table.complete, $series_table.user_id, $series_table.series_title, $users_table.name, $chapters_table.id as chid, CONCAT_WS('$chapter_separator', $chapters_table.chapter_num, $chapters_table.chapter_title) AS chapter_title, $chapters_table.chapter_num, $chapters_table.summary, $chapters_table.notes, DATE_FORMAT($chapters_table.date, '$date_format') AS date_f, $ratings_table.name as rating_name FROM $stories_table LEFT JOIN $series_table ON $series_table.id=$stories_table.series_id LEFT JOIN $users_table ON $users_table.id=$series_table.user_id LEFT JOIN $chapters_table ON $stories_table.id = $chapters_table.story_id LEFT JOIN $ratings_table ON $ratings_table.id = $stories_table.rating WHERE $chapters_table.story_id = $story_id AND $chapters_table.chapter_num = $chapter_num";
Could this be the source of my problems? If so, do you know any alternative that doesn't load the server that much? I'm getting really desperate with this.
My host uses mysql version 4.0.27.
Thanks!
Source: http://community.livejournal.com/mysql/119223.html
|