website database

Problems with the Windows version of XAMPP, questions, comments, and anything related.

website database

Postby alpha13 » 05. November 2012 23:04

Hello everyone,

I have a hosted website with a database

I have installes xampp (a week ago) on my win7 pc
I transfered the web site and the database
using phpmyadmin I can see that the database is correctly imported and the website works, but...

The data in the database is not visible in my website, although I set the access permissions in xampp completely open (total access for everyone from any machine)
In phpmyadmin i can see the database is populated.

Any idea?

PS: Previously I was using virtual box with linux open suse and that worked fine, but slow
alpha13
 
Posts: 5
Joined: 05. November 2012 22:52
XAMPP Version: 1.7.2
Operating System: win7

Re: website database

Postby Nobbie » 05. November 2012 23:14

What kind of software are you running there? Something like Joomla, Wordpress or similar, or your own scripts?
Nobbie
 
Posts: 6918
Joined: 09. March 2008 13:04

Re: website database

Postby alpha13 » 05. November 2012 23:26

I'm just using my own php scripts, very straight forward, and the strange thing is they all work well on my hosted website
alpha13
 
Posts: 5
Joined: 05. November 2012 22:52
XAMPP Version: 1.7.2
Operating System: win7

Re: website database

Postby Altrea » 06. November 2012 00:58

Hi alpha13,

alpha13 wrote:The data in the database is not visible in my website, although I set the access permissions in xampp completely open (total access for everyone from any machine)

Be careful using wildcards (% = Any) in mysql login credentials.
If you have multiple users that can fit a login action, the user which is most specific will be the one which is used.

Means from high priority to low:
  • specificuser@specifichost
  • Any@specifichost
  • specificuser@Any
  • Any@Any

So, a user Any@localhost (which is one of the mysql default user) will match with higher priority then your specificuser@Any. Maybe that is the problem why the data is not visible for your user.

If the HTTP Daemon (Apache httpd) and the Database Daemon (MySQL mysqld) are on the same machine, simply use localhost as mysql host for all mysql users.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6758
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

Re: website database

Postby alpha13 » 06. November 2012 01:49

I have, for testing purposes, all credentials open.
The stange thing is that phpmyadmin shows dat de database is populated.

The script which I include in my website is:
public function __construct () {
parent::__construct ();
$this->db_host = 'localhost';
$this->db_user = 'root';
$this->db_pass = '';
$this->db_name = 'snooker';
if (!mysql_connect ($this->db_host, $this->db_user, $this->db_pass)) {
array_push ($this->errs, '<p>Connectie met DB is mislukt.</p>');
}
if (!mysql_select_db ($this->db_name)) {
array_push ($this->errs, '<p>Fout bij het selecteren van de database</p>');
}
}
which can hardly be more open :)

Should I change something in de config files of Xampp?
alpha13
 
Posts: 5
Joined: 05. November 2012 22:52
XAMPP Version: 1.7.2
Operating System: win7

Re: website database

Postby Altrea » 06. November 2012 05:31

Sorry, this information is not enough to identify your issue.
We need the full error message (e.g. mysql_error())
and the output from your \xampp\mysql\data\mysql_error.log
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6758
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

Re: website database

Postby Nobbie » 06. November 2012 10:00

Usually, hosted websites with a database, do NOT apply a local database ("localhost"), but a unique server ("dbblabla11112222" or similar). As well, they do not allow root access and as well not empty passwords.

This is due to the problem, that the database is shared for many hosted websites. You need to have at least a "Virtual Server" or a "Root Server" package in order to run your own local database. You should find out the database credentials (given from your provider) as well as the database name for your website IF it differs from localhost.
Nobbie
 
Posts: 6918
Joined: 09. March 2008 13:04

Re: website database

Postby alpha13 » 06. November 2012 17:09

Thanks for the reply everyone.
Althea, here is the mysql_error.log
121106 16:58:37 [Note] Plugin 'FEDERATED' is disabled.
121106 16:58:37 InnoDB: The InnoDB memory heap is disabled
121106 16:58:37 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121106 16:58:37 InnoDB: Compressed tables use zlib 1.2.3
121106 16:58:37 InnoDB: Initializing buffer pool, size = 16.0M
121106 16:58:37 InnoDB: Completed initialization of buffer pool
121106 16:58:37 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
121106 16:58:37 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
121106 16:58:37 InnoDB: Waiting for the background threads to start
121106 16:58:38 InnoDB: 1.1.8 started; log sequence number 1959530
121106 16:58:38 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
121106 16:58:38 [Note] - '0.0.0.0' resolves to '0.0.0.0';
121106 16:58:38 [Note] Server socket created on IP: '0.0.0.0'.
121106 16:58:38 [Note] Event Scheduler: Loaded 0 events
121106 16:58:38 [Note] c:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.25a' socket: '' port: 3306 MySQL Community Server (GPL)

Altea:For testing purposes, I set all users have all priveleges and I access the website with localhost indeed

Nobbie:
On my website hoster I indeed I use sensescore.nl with a specific user and password, that's correct
alpha13
 
Posts: 5
Joined: 05. November 2012 22:52
XAMPP Version: 1.7.2
Operating System: win7

Re: website database

Postby alpha13 » 06. November 2012 17:24

To be more explicit about the priveleges I assigned:
user machine type priv assigned
every % global all yes
every linux global all yes
every localhost global all yes
pma localhost global all yes
root linux global all yes
root localhost global all yes
simon localhost global all yes

Regards
alpha13
 
Posts: 5
Joined: 05. November 2012 22:52
XAMPP Version: 1.7.2
Operating System: win7


Return to XAMPP for Windows

Who is online

Users browsing this forum: Altrea and 39 guests