Hi Sean,
The vanilla script has no password as it is designed for demo only. If you set a password for root, then you would need to add it. Better yet, change the credential to something you know works and has access to the MySQL db.
When using the `/usr/local/mysql/bin/mysql -u root -p` syntax I find this works best:
mysql -u mpavlak --password='yourPassword'
Regards,
Mike
Office Phone: (708)233-5880 Cell: (408)679-1011
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Porterfield, Sean
Sent: Tuesday, October 30, 2012 8:12 AM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Zend and V7R1
Gee, thanks, Mike - now I learned MySQL is broken too! My question below was about mssql connections failing. I don't see any real data in /usr/local/mysql/data/ - I just have mysql and test databases.
The mysql script you mention returns: Access denied for user 'root'@'localhost' (using password: NO)
That sounds so familiar... Oddly, I get the same error from `/usr/local/mysql/bin/mysql -u root -p` which should prompt for a password.
I'll look into hotfixes. I thought downloading the latest and greatest version would include everything.
--
Sean Porterfield
-----Original Message-----
From: Mike Pavlak
Sent: Monday, October 29, 2012 17:58
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Zend and V7R1
Hey Sean,
I don't mean to but in but maybe a couple of low hanging pieces of fruit.
1) Does the demo script work that comes with Zend Server? Works on mine.
http://192.168.15.112:10088/Samples/MYSQL_access/mysql_access_example.php
2) Do you have the Hot fixes applied? There are 4 and one includes updates to PHP. Not sure if there is anything in there about MySQL, but you never know.
3) Is the MySQL extension enabled in the Zend Server admin interface? Server setup->Extensions->mysql
4) I'd assume MySQL is running and that you are using the same credentials since the app is working in Core.
5) If you are making any changes to my.cnf, please make them under the /usr/local/mysql/bin and there is more detail at
http://forums.zend.com/viewtopic.php?f=64&t=3924
Hope this helps!!!
Mike
Office Phone: (708)233-5880 Cell: (408)679-1011
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Porterfield, Sean
Sent: Monday, October 29, 2012 4:16 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Zend and V7R1
I should have been more clear when I said "Both my stripped down and full script now work in Core but not in Server from the same system."
What I meant was that I get the exact same error from Zend Server when the script does nothing but connect. Since that's where it failed in my original script, it really didn't prove much, but it did let me ensure I didn't have some other problem interfering with the error message I saw.
cat ms.php
<?php
$connSQL = mssql_connect('myserver','user','password');
if ($connSQL) {
echo "Success!\n";
} else {
echo "SQL Connection failed.\n";
}
?>
$
/usr/local/zendsvr/bin/php-cli ms.php
[29.10.2012 17:08:04 SYSTEM] Zend Monitor UI is disabled in CLI/CGI run...
PHP Warning: mssql_connect(): Unable to connect to server: myserver in ms.php on line 2 SQL Connection failed.
$
/usr/local/zend/core/bin/php ms.php
Success!
$
(Names have been changed for obscurity, but it's clear that it doesn't connect from Zend Server and does from Zend Core.)
--
Sean Porterfield
-----Original Message-----
From: Alan Seiden
Sent: Monday, October 29, 2012 16:34
To: Web Enabling the AS400 / iSeries
Cc: Porterfield, Sean
Subject: Re: [WEB400] Zend and V7R1
What happens now when you run the stripped-down version in Zend Server?
On 10/29/12 1:13 PM, Porterfield, Sean wrote:
Yes, the script works fine on Zend Core on my production system. I'm able to ping the server from the backup system where I installed Zend Server.
The script failed on the backup system in Zend Core before it got to that line, so I don't know if the mssql part works there.
I decided to strip it down to just the mssql_connect() and test with
Zend Core. I got an error that the function didn't exist. (I lost
the exact output, but that's close enough probably.)
When I tried to check /usr/local/Zend/Core/etc/php.ini, I noticed I didn't have access to view it. I updated the directory and file permissions and no longer got the function doesn't exist error. Both my stripped down and full script now work in Core but not in Server from the same system.
--
Sean Porterfield
From: Alan Seiden [mailto:alan@xxxxxxxxxxxxxx]
Sent: Monday, October 29, 2012 14:20
To: Web Enabling the AS400 / iSeries
Cc: Porterfield, Sean
Subject: Re: [WEB400] Zend and V7R1
Sean, I will try for 3 out of 3:
Don't you find the error message a bit suspicious?
Unable to connect to server: myservername
Do you have a server called "myservername?"
Alan
On 10/29/12 10:14 AM, Porterfield, Sean wrote:
Looks like you're 2/2.
Not authorized to object. Object is /etc/zce.rc.
/usr/local/ZendSvr/etc is configured as *PUBLIC *EXCLUDE. I changed that, so I can read the file.
Now I get:
PHP Warning: mssql_connect(): Unable to connect to server:
myservername in myscript.php on line 10
Did mssql_connect() change as well?
I'm on my backup system, so I can't be sure it worked before, as I only ran it on the production system. I just tried running it in Zend Core on the backup system, but I got an error about undefined function ldap_connect() on line 3 which probably isn't worth troubleshooting.
I do see in the production Zend Core php.ini:
extension=mssql.so
Adding that to the zendsvr php.ini didn't help.
Sean Porterfield
Sr. Systems and Network Engineer
Beacon Roofing Supply
919-739-8126
From: Alan Seiden
Sent: Friday, October 26, 2012 16:27
To: Web Enabling the AS400 / iSeries
Cc: Porterfield, Sean
Subject: Re: [WEB400] Zend and V7R1
Sean,
Could be a permissions issue with the user profile you are using. See this forum posting:
http://forums.zend.com/viewtopic.php?f=77&t=8819
I'll jump right to the punch line:
"/etc/zce.rc is a symbolic link to /usr/local/zendsvr/etc/zce.rc.
Therefore, you must set permissions on the /usr/local/zendsvr/etc folder as well."
Alan
On 10/26/12 1:08 PM, Porterfield, Sean wrote:
/usr/local/zendsvr/bin/php-cli myscript.php
/etc/zce.rc doesn't exist!
--
Sean Porterfield
This email is confidential, intended only for the named recipient(s) above and may contain information that is privileged. If you have received this message in error or are not the named recipient(s), please notify the sender immediately and delete this email message from your computer as any and all unauthorized distribution or use of this message is strictly prohibited. Thank you.
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.