I want to run a website on a server (actually only part of the server) I have a very limited access to. The only two things I can do is to connect via FTP to my part in the server and to connect to one MySQL database.
On this server I want to run some PHP code which uses PDO. The problem is that PDO is not enabled on this server.
So what can I do to have PDO on this server with the access I have?
Some more information on the server: It is a Windows server which runs Microsoft IIS 6.0. It has PHP 5.2.3.
If PDO isn't enabled (check <? phpinfo(); ?>) there's not much you can do... It can't be enabled without access to the PHP configuration on server level.
Did you mean: permissions?
When you connect the database with pdo, then you set the user. If in the phpmyadmin create the user with low permissions, then you can connect with this user in php pdo.
Example, if you created the user name of: readonly, and set readonly user password and permissions, then in connection you can use this user and password.
Sry for my english!
Related
I'm using SqlSrv to connect to a Microsoft SQL Server. So far I was struggling to get SqlSrv to work, but that's ok now. On a Windows 2012R2 machine with XAMPP (PHP 5.5.19) I'm trying to connect to the database using Windows Authentication.
According to the documentation I'm using SQL Server Authentication when I'm providing UID and PWD in the connection options. So I left those options out but now the server tries to connect to the database as Domain\ServerName instead of Domain\MyWindowsUserAccountName. How can I set up the script to connect with my user credentials? Maybe I'm missing out on something obvious in the documentation...
According to document you should set Trusted_Connection to "yes"
I'm trying to get a site running locally that is currently running on a dev server running PHP 5.3.10. It connects to a MySQL server that is version 5.5, but has old_passwords set to ON.
The site works on the dev server.
On my local, I am running PHP 5.3.26 and when trying to connect I get:
Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
I understand that this is an issue with the old_password variable, but it is running on the dev server with PHP 5.3.
Edit:
Here's my local mysql section from phpinfo():
The dev server's mysql section:
How do I set up my local to match the dev server?
The PHP version is not the problem here, as of PHP 5.3 "old" MySQL passwords are not supported anymore. Probably two different permission profiles are applied. Are you connecting to the same server? Then something like this could be happening:
User Host
youruser % (using old-style password)
youruser localhost (using new-style password)
That you are using the same credentials does not necessarily mean that those are referring to the same account or permission profile.
I am very new to this server setup and database connectivity. I googled a lot but couldn't find the solution for it.I am developing an android application which needs to post data to remote database. Which is done.
Now i have to setup MySQL Database in the new Windows Server 2008. I have installed and managed to get access the root user(Which is fine). Now i want to access this database from my local computer[Which is iMac]. I already set the privileges by following this link. When i tried to run from my web application it shows the following error.
Error: unable to connect to database. Host 'xx.xx.xxx.x' is not allowed to connect to this MySQL server
Here is my questions
1.) How to get access to the remote MySQL database from any computer?
2.) How to run the web application in the server?Like Web Hosting i.e Do i need to setup ftp account and put the stuff over there?(For Eg: testhost.com/connecttodatabase.php by executing this it will execute whatever code in testhost server. But i have no idea how to do that for my server).
Any help is much appreciated.
Alternately, You can also try...
use the_database_name;
GRANT ALL PRIVILEGES ON
the_database_name.*
TO
'the_user_in_php_code'#'%'
IDENTIFIED BY
'password_of_the_user_in_php_code';
FLUSH PRIVILEGES;
source:
http://forums.devshed.com/mysql-help-4/host-is-not-allowed-to-connect-to-this-mysql-server-366908.html
I have a website and a database on a host. But I want the administrator panel on my laptop? Is it possible connect remotely? How can I do this? Thank you very much!
If I've understood correctly your question, you're looking for a GUI front-end for a remote MySQL database. There's many MySQL front-ends out there, but two I would recommend are the official MySQL Workbench if you're running Windows or Linux, and Sequel Pro if you're running Mac (MySQL Workbench can also run on Mac, but I personally prefer Sequel Pro). Both are free.
The first thing you should try is simply connecting to the remote MySQL server by the command line.
$ mysql -u your_user -h remote.host.name -p
Depending on the output will determine what you need to do next.
Error 1
ERROR 2003 (HY000): Can't connect to MySQL server on 'remote.host.name' (113)
This means that the port is not even open for an external machine to connect to it, so you will need to add whatever port MySQL is running on to your firewall to accept incoming connections.
Error 2
ERROR 1045 (28000): Access denied for user 'your_user'#'your.host.name' (using password: YES)
Assuming that your login credentials are correct, this means that you need to grant permissions from within MySQL. Connecting locally from the remote server, grant permissions like this:
GRANT ALL ON your_database.* TO your_user#'your.host.name' IDENTIFIED BY 'your_password';
Obviously substitute all of the relevant things to what they should be.
When you can connect by command line, connecting by PHP is as simple as using the hostname, username and password information that you used in the mysql command above.
You can use a piece of software called Chive to do this, however it's possible that your server doesn't accept connections remotely.
You can either install Chive locally on your machine and connect to the remote computer, or install Chive remotely and connect to it via HTTP (though I strongly recommend HTTPS).
http://www.chive-project.com/
Wow, just like you connect to the site, you should only change the authentication data if necessary, and external IP mysql.
For a school project, I have installed MediaWiki on my local machine, and am required to have any database connection to the local MySQL database use SSL. I am unsure of how to connect all the dots. Here's what I have done so far:
I have installed OpenSSL, and created a self-signed certificate, and associated keys.
phpinfo() shows OpenSSL as being enabled.
I have included this in the [mysqld] section of my.ini:
ssl-key="C:/newcerts/server-key.pem"
ssl-cert="C:/newcerts/server-cert.pem"
ssl-ca="C:/newcerts/ca-cert.pem"
Running MySQL Command Line prompts me for the root password, and upon entering it, I get Error 1045:Access denied, etc.
Running mysql -u root -p ssl-ca="C:/newcerts/ca-cert.pem" from the bin directory and entering the password succeeds, and gives me a mysql prompt. Running status shows SSL: Cipher in use is DHE-RSA-AES256-SHA.
Here's where I'm confused. What else needs to be done (like through Apache or a PHP config file, or a MediaWiki file) to require database connections to use SSL?
You're going to want to use the mysqli extension because the native php/mysql extension does not support SSL. See the mysqli SSL related function:
http://us.php.net/manual/en/mysqli.ssl-set.php
That being said, the DB class in MediaWiki is abstracted out, but to the best of my knowledge the existing implemenation uses the regular php/mysql, NOT mysqli so I think you're going to have write your own mysqli adapter, or maybe somebody already has.
Either way you will need to get MediaWiki to use a mysqli adapter.