<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Rob,<br>
<br>
On 25/05/12 11:57, Berry, Rob wrote:
<blockquote
cite="mid:9DF271B619CB384F821EBDEC3109FC5C0F7B6EBB@BHEXMBX2.livad.liv.ac.uk"
type="cite">
<pre wrap="">Hey,
Two quick queries:
# Connecting to MySQL databases
I've been trying to connect to the one of the MySQL databases generated by EPrints, as created through the Debian repository.
I'm using the details from /archives/<archive_name>/cfg/cfg.d/database.pl. However, MySQL returns the following:
robert@robert-uol:~$ mysql -u test -p
Enter password:
ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)
</pre>
</blockquote>
<br>
Perhaps try with the database name: mysql -u <username> -p
<db_name> ?<br>
<br>
<blockquote
cite="mid:9DF271B619CB384F821EBDEC3109FC5C0F7B6EBB@BHEXMBX2.livad.liv.ac.uk"
type="cite">
<pre wrap="">
Is there something I'm missing? The reason I wanted to actually do this is to check what data is in the database itself, as I was having another problem, detailed below.
# Searching by divisions with the EPrints API
I'm writing a script at the moment to move all prints from within one division into another. I have a function that is supposed to look up all prints in a given division (which I am passing as a string): <a class="moz-txt-link-freetext" href="https://gist.github.com/2787296">https://gist.github.com/2787296</a>
However, iterating through all the divisions in the subjects file, this function always returns a result set of zero prints. Is there something I'm doing wrong? Or is this something to do with the test data imported into EPrints 3? (This is why I wanted to have a look at the data on a database level.)
</pre>
</blockquote>
<br>
<pre><div class="line" id="LC7"><span class="k">sub </span><span class="nf">prints_for_division</span> <span class="p">{</span></div><div class="line" id="LC8"> <span class="k">my</span> <span class="p">(</span><span class="nv">$session</span><span class="p">,</span> <span class="nv">$division</span><span class="p">)</span> <span class="o">=</span> <span class="nb">shift</span><span class="p">;
<b>Should be</b></span><span class="k">
sub </span><span class="nf">prints_for_division</span> <span class="p">{</span><pre><div class="line" id="LC8"> <span class="k">my</span> <span class="p">(</span><span class="nv">$session</span><span class="p">,</span> <span class="nv">$division</span><span class="p">)</span> <span class="o">=</span> <span class="nb">@_;</span><span class="p"></span></div></pre>
Otherwise only $session will get $_[0] and $division will remain "undef". "shift" only returns the first element of an array.
Seb.
</div></pre>
<br>
</body>
</html>