Page 1 of 1

website database

PostPosted: 05. November 2012 23:04
by alpha13
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

Re: website database

PostPosted: 05. November 2012 23:14
by Nobbie
What kind of software are you running there? Something like Joomla, Wordpress or similar, or your own scripts?

Re: website database

PostPosted: 05. November 2012 23:26
by alpha13
I'm just using my own php scripts, very straight forward, and the strange thing is they all work well on my hosted website

Re: website database

PostPosted: 06. November 2012 00:58
by Altrea
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

Re: website database

PostPosted: 06. November 2012 01:49
by alpha13
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?

Re: website database

PostPosted: 06. November 2012 05:31
by Altrea
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

Re: website database

PostPosted: 06. November 2012 10:00
by Nobbie
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.

Re: website database

PostPosted: 06. November 2012 17:09
by alpha13
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

Re: website database

PostPosted: 06. November 2012 17:24
by alpha13
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