我知道有很多这样的问题,但我没有找到任何解决方案.
我试过的事情: -
检查防火墙
重新启动我的PC和Apache服务器
重启MYSQL
检查了我的代码
尝试了我所知道并在互联网上找到的一切
这是我的代码: -
<?php
$dbhost = 'localhost:3360';
$dbuser = 'root';
$dbpass = '';
$db = 'test_db13';
$conn = mysqli_connect($dbhost,$dbuser,'',$db);
if(! $conn){
die('Could not connect connect: ') ;
}
echo 'Successfully Connected';
$sql = 'Connected Successfully';
$retvalue = mysqli_query($sql);
if(! $retvalue){
die('Cannot connect to SQL: ');
}
echo 'DataBase test_db13 has successfully created';
mysqli_close($conn);
?>
Run Code Online (Sandbox Code Playgroud)
我确实设置了密码,但它仍然显示错误.
这是防火墙图片: -

最后XAMMP在这里运行是证明

我正在编写一个简单的 AES 加密代码。我被困在一个部分,它说在加密()之后不能调用解密()。我通过互联网报废寻找解决方案,但无法这样做,可能是因为缺乏适当的文档示例。
我尝试更改这些行的顺序,但没有帮助
encrypted = encrypt(message)
decrypted = decrypt(encrypted)
Run Code Online (Sandbox Code Playgroud)
我有2个例子
示例 1
from Crypto.Cipher import AES
key = 'ACD310AE179CE245624BB238867CE189'
message = 'this is my super secret message'
cipher = AES.new(key.encode('utf-8'),AES.MODE_CBC)
def pad(s):
return s + ((16 - len(s) % 16) * '{')
def encrypt(plaintext):
global cipher
return cipher.encrypt(pad(plaintext).encode('utf-8'))
def decrypt(ciphertext):
global cipher
dec = cipher.decrypt(ciphertext).decode('utf-8')
l = dec.count('{')
return dec[:len(dec)-1]
encrypted = encrypt(message)
decrypted = decrypt(encrypted)
print("Message: ", message)
print("Encrypted: ", encrypted)
print("Decrypted: ", decrypted)
Run Code Online (Sandbox Code Playgroud)
示例 2
from Crypto.Cipher …Run Code Online (Sandbox Code Playgroud) 我试图遍历来自app.js的对象。我在PUG / JADE中使用每个循环,以便可以使用其值来打印一些值。但是li没有得到循环变量的值
注意:我的“ post.title”和“ post.body”低于4倍,因为它来自mongo数据库,而我在数据库中恰好做了4个条目。加上这也意味着对象正确地进入了索引页,但是li没有获得循环变量的值。
我得到的输出
. = post.title
. = post.body
. = post.title
. = post.body
. = post.title
. = post.body
. = post.title
. = post.body
Run Code Online (Sandbox Code Playgroud)
我想要的是
Title of the post
body of the post
Title of another post
Body of another post
and so on....
Run Code Online (Sandbox Code Playgroud)
我的密码
---- index.pug ----
block content
ul
each post in posts
li = post.title
li = post.body
Run Code Online (Sandbox Code Playgroud)
---- app.js ----
let Post = require('./models/post');
app.get('/', function(req, res){
Post.find({}, …Run Code Online (Sandbox Code Playgroud) aes ×1
encryption ×1
express ×1
jade4j ×1
mysqli ×1
node.js ×1
php ×1
pug ×1
pycryptodome ×1
python-3.x ×1
xampp ×1