I'm trying to install a php script locally on IIS.
I've gotten to the point where I need to fill in my database information.
I've connected to another database through visual studio, here's the connection string:
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\TaskSubmitter.mdf;Initial Catalog=TaskSubmitter;Integrated Security=False; User Id=sa; Password=thepassword"
Now I've created a database named "pligg" for the php script.
The information I've filled in is the following:
Database name: pligg
Database username: sa
Database password: thepassword
Database server: (LocalDb)\v11.0
Table prefix: _pligg
However I get an error when trying to connect through the script.
The script is working fine so I'm sure I've done something wrong regarding the settings or the database.
Anyone know what could be wrong?
Related
I am using PHPMyAdmin 4.2.11 and Drupal 7.37
I created a database in PHPMyAdmin called drupaldatabase and now I'm trying to add it on Drupal using database name: drupaldatabase and username root with no password.
If you need any more info let me know.
You should make sure your database is empty by killing it
mysql> DROP DATABASE drupaldatabase;
And create database again:
mysql> CREATE DATABASE drupaldatabase;
MySQL configuration:
autocommit = on
Where is mistake? I try to connect to database from php script. I am getting the error that database is unknown. Database for sure exists, i can see this from PhpMyAdmin.
I use XAMPP v3.2.1 with mysqlnd 5.0.11-dev and php v5.5.9.
Script file debug1.php in folder c:\xampp\htdocs:
$conn=mysqli_connect( 'localhost', 'root', '', $vdbname ) or die( "cannot connect to server".mysqli_error() );
When i run this file from browser windows using url: "localhost/debug1.php" i am getting error message:
Warning: mysqli_connect(): (HY000/1049): Unknown database 'gintare_calendar' in C:\xampp\htdocs\debug1DBconn.php on line 5
You may want to look for whitespace in database name. From phpMyAdmin go to database Operation sections and see if white space has been added in front or after database name.
This means the database you want to connect to is not called "gintare_calendar".
Open your MySQL administration package (phpmyadmin) and verify the actual name of the database you want to connect to.
I am sorry, i forget that i reinstalled XAMPP. It is true. There is no database. I have to create the database, import previous tables and than everything works again.
I am new to WebMatrix and MySQL, and I need some assistance with an issue.
I'm trying to code with PHP and MySQL in WebMatrix 3. I am experimenting with scripts in a site file called "Starter PHP site". WebMatrix is not showing a database created with the $sql="CREATE DATABASE my_db"; script when I navigate to the "Databases" section in the program. This image shows what part of the program I'm talking about.
(source: orchardproject.net)
When I click the "Databases" button in the lower left corner of the UI, all that is shown in the left pane is a "Starter PHP site" folder icon (for creating a MySQL databse for my site from the WebMatrix UI) and an "Other Connections" icon -- but not the database created (my_db) after running the script above.
I know that the database exists...because when I run the script above again with some extras--
$con=mysqli_connect("localhost","xxxx","xxxxxxxx");
$sql="CREATE DATABASE my_db";
if (mysqli_query($con,$sql))
{
echo "Database my_db created successfully";
}
else
{
echo "Error creating database: " . mysqli_error($con);
}
--I get an error saying that "my_db" already exists. Why doesn't WebMatrix show my_db in the "Databases" section...after I've run the script to create the database?
What am I missing here?
Any advice is greatly appreciated.
If it's there you should see it as such:
Dumb question, but have you tried refreshing?
It seems that I have found some sort of solution. Apparently, WebMatrix 3 might not show MySQL databases created with PHP scripts automatically, but you can view databases created with scripts by creating a new MySQL database connection to the database of interest from the WebMatrix GUI.
Solution: Navigate to the "Databases" section.... Select "New," then..."MySQL Connection." Then, enter the database information.... You should now have a working database connection.
...sorry if this is one of those newbie mistakes. I should have tried this earlier, but one might think that, since one has to establish a database connection in the PHP code, WebMatrix would automatically connect to it. For me, that isn't the case.
When I launch the website through local host, I get the following error:
Database Error: Unknown database 'db_name'
I'm having a dig around as to what the problem is. The website belongs to a friend of mine and he wants me to connect the website to the database. The database resides within the root directory. I'm merely trying to connect to it.
In most of the PHP files, there is a tag that includes the config file which contains the details of the database.
Any ideas as to how I can get it working and resolve the Database Error: Unknown database 'db_name' error?
Any help is highly appreciated.
Database should not reside in root directory, it should be imported to database (Mysql) server.
Check in Mysql databases, does your database resides there?
If not, you can do so by phpMyAdmin or navigating to your mysql and importing it.
Create database in mysql and import the sql file as below by opening command-line terminal:
/path/to/mysql/bin > mysql -u username -p < /path/to/root/db.sql
I've downloaded the wamp server and it's online. I'm trying to install Joomla.
At page 4 I'm told Unable to connect to the database
An error has occurred:The database details provided are incorrect and/or empty.
Can anyone help me in fixing this error?
This problem has been fixed by Ocaso Protal, finaly this page ocurs
what should I put here ?Site Name? nd finaly why should i use joomla any specific properties of this product ?
Even if you use the default settings for mysql (user: root, password empty) you should put the username root in the Username field in the form that's showed in your first screenshot.
You must check these things before
Setup a blank database from the Cpanel/Mysql Admin
Fix the username/password and user permissions on this database
Run Joomla... and give it the above credentials + localhost
Make sure you have 777 or adequate permissions otherwise some errors may occur#
If im not mistaken the default account for wamp/xamp myqsl is
user: "root"
password: ""
//Password is null - do not write nothing inside