Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have this silly problem with mysql that I don't understand.
First of all, the mysqld is up and running smoothly. I can connect to it with mysql and do with the tables whatever I please.
The funny thing is that with PHP I cannot insert stuff into tables. I have used Grant all on ... command to ensure that users apache and mysql have privileges to mysql.
I'm sure if you give us a sample output of code, someone might tell you where the problem is along with the errors you get, etc. More details or were as clueless as you are.
Yes that's the joke. Te code worked before (reinstall). And yes, I have installed all the components needed for it to work (at instalation). I don't get any errors from executing the code. If I didn't install it correctly there would be some errors.
The fuzzines is in the fact, that php reads nicely from mysql database but won't for some reason write to it. I don't know what's going on.
I am running PHP-4.3.3
I am running MySQL-3.23.58
I know it works, because it reads from it. But why oh why won't it write to it. I will give you a list of my user table and db table.
USER table
+-----------+--------+----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv |
+-----------+--------+----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
| localhost | root | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| soba-210 | root | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| localhost | | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| soba-210 | | | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
| localhost | apache | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| localhost | bojan | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| localhost | mysql | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | Y | Y | Y |
+-----------+--------+----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
DB table
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+
| Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv |
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+
| % | test | | Y | Y | Y | Y | Y | Y | N | Y | Y | Y |
| % | test\_% | | Y | Y | Y | Y | Y | Y | N | Y | Y | Y |
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+
So I assume that if you use a mysql shell you can do write operations to the DB when using the same login credentials as what you have your PHP script using?
And the MySQL server is on the same machine as Apache isn' it?
I tried loging in as apache and mysql and in the shell it worked fine. Is it possible that apache is using any other user or PHP is using any other user. in httpd.conf there is user apache and group apache, which I haven't changed
This is really starting to annoy me. Why doesn't it work if it works Reading yes, writing no. There must be something fishy.
And yes Apache and MySQL are both on the same machine.
I checked /var/log/mysqld.log and found these:
Cannot initialize InnoDB as 'innodb_data_file_path' is not set.
If you do not want to use transactional InnoDB tables, add a line
skip-innodb
to the [mysqld] section of init parameters in your my.cnf
or my.ini. If you want to use InnoDB tables, add to the [mysqld]
section, for example,
innodb_data_file_path = ibdata1:10M:autoextend
But to get good performance you should adjust for your hardware
the InnoDB startup options listed in section 2 at http://www.innodb.com/ibman.html
/usr/libexec/mysqld: ready for connections
Anyone knows what it means. And is there a log for every mysql transaction?
Hmm InnoDB... you probably don't want to use that table type. I don't ave any experience with it, or if that error message even indicates you are using it, but you might wanna try and make sure your tables are MyISAM.
I just want to shoot myself now. The reason the bloody thing wasn't working is my own stupidity. I had PHP code designed so that it would work under Linux and Windows. I did some modifications to it under windows, but I didn't make those same modifications to it for Linux. Sorry, for presenting an unsolvable problem to you guys.
Thanks for banging your head against the wall anyway. Appreciate it.
I just excluded code problems, because under windows it worked, but now I migrated over to Linux (about time) and it just stoped.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.